Skip to Content
Former Member
Aug 24, 2012 at 02:57 PM

UserPermissionTree.Levels changed to read-only?


Hi all:

I am trying to create some user-defined permissions for an add-on in C#. While trying to create them, contrary to the SDK documentation, apparently the Levels property of the UserPermissionTree is now read-only. Here's my code, maybe someone can confirm this problem/change of behaviour, or point out the correct way to create child permissions, as it is possible in the UI.

UserPermissionTree oPermission = (UserPermissionTree)oCompany.GetBusinessObject(BoObjectTypes.oUserPermissionTree);

if (!oPermission.GetByKey(permissionID))


oPermission.PermissionID = permissionID;

oPermission.Name = description;

oPermission.Options = options;

if (parentID != null)


//oPermission.Levels = 2; // "this property cannot be assigned to"

oPermission.ParentID = parentID;


result = oPermission.Add();


Any clues?