Getting a list of attributes.

May 28, 2009 at 4:51 PM
Edited May 28, 2009 at 4:52 PM


Is it possible to get a list of attributes associated to a user without having to check access for a specific role.

For example currently I can get a list of attributes as follows

<KeyValuePair<string, string>> _attributtes;

AuthorizationType auth = _userPermissionCache.CheckAccess("SystemAdmin", DateTime.Now, out _attributtes);

But this requires me to pass in the the role.

I was looking for something more like

_attributtes = _userPermissionCache.GetAllAttributes( );

I noticed that the userPermissionCache does have a list of all the attributes

i.e _userPermissionCache.checkAccessTimeSlice[0].Attributes but this is a Non-Public list and doesn't seem to be accessible.

Is it possible to get a list of all attributes for a user and if so how.


May 28, 2009 at 8:40 PM

Hi Aminur,

typically the attributes are used, for the same permissions, to distinguish different users on different Scopes.

In this sense there is no concept of User attributes ... instead Authorizations attributes. As conseguenze the only way to have the attributes is to perform 1 or more CheckAccess.

If you have performance related issues, consider the adoption of the StorageCache object.

The Internal “attributes” property of the UserPermissionCache is used only to retrieve attributes when you call CheckAccess method on the UserPermissionCache itself.