Portal Engine
Version 3.x > Portal Engine > ACLs and the API View modes: 
User avatar
Member
Member
friism-gmail - 12/8/2008 9:00:10 AM
   
ACLs and the API
The AclProvider has a SetUserPermissions method with various ints as parameters. I'm assuming these are bitmaps, and I can sort of guess the values I want by poking around in the database. I'm curious to know if there's any documentation available though?

Michael

User avatar
Member
Member
friism-gmail - 12/8/2008 9:28:17 AM
   
RE:ACLs and the API
Ah, "NodePermissionsEnum" is your friend.

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 12/8/2008 12:39:50 PM
   
RE:ACLs and the API
Hi Michael,

Your assumption with bit mapping is correct.
You could find the SetUserPermissions method specification in the API reference, available in your Kentico installation or downloadable from http://devnet.kentico.com/downloads/kenticocms_api.zip

It is defined as:
public virtual void SetUserPermissions(TreeNode node, int allowed, int denied, UserInfo userInfo)

In the API reference, which is besides the DevGuide the only documentation about API, there is unfortunatelly not everything you might want to know, so I'll try to explain:

'allowed' and 'denied' variables (Int32) hold permission flags for
every permission in one bit. The permissions are checked using binary shifting and modulo:

allowed >> Convert.ToInt32(permission)) % 2 == 1
(the same for 'denied')

permission – NodePermissionEnum - is enumeration which integer
value represents position of the bit holding the permission settings
The enumeration is described in the API reference.
Permission bits are:
0 - Read
1 - Modify
2 - Create
3 - Delete
4 - Destroy
5 - ExploreTree
6 - ModifyPermissions

Hope this sheds more light to the security handling.
Please let us know if you need more details.

Regards,
Zdenek Cetkovsky, Kentico

User avatar
Member
Member
friism-gmail - 12/8/2008 12:42:33 PM
   
RE:ACLs and the API
Thanks for the answer, I guess probably the best example is likely CMSDesk\Content\Properties\security.aspx.cs, where you guys set the permissions.

Michael