Return ApplicationGroup Roles.

Topics: NetSqlAzMan Core
Feb 22, 2011 at 1:17 PM

Hello.

First of all i have to say thanks for your good support and your fantastic library.

How can i Get All Roles of an applicationGroup ?

i am using this code to get all Roles that belongs to an user.

 

Dim sc As NetSqlAzMan.Cache.StorageCache

sc.BuildStorageCache()
            Dim authorizedItems As AuthorizedItem() = sc.GetAuthorizedItems(StoreName, ApplicationName, Storage.GetDBUser(UserName).CustomSid.StringValue, DateTime.Now)
            authorizedItems = (From t In authorizedItems Where t.Authorization = AuthorizationType.Deny OrElse t.Authorization = AuthorizationType.Neutral).ToArray()

Regards shaahin.

 

Feb 23, 2011 at 9:31 AM

Hi,

to get all User Roles you must invoke a CheckAccess for each Role and get only results that are Allow or AllowWithDelegation.

To get all Roles of an ApplicationGroup you have to get before all the application group members and for each member invoke a CheckAccess; then consider only results that are Allow or AllowWithDelegation.

Regards,

Andrea.

__________________________________
Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com

Feb 23, 2011 at 9:41 AM

Thank You.

isn't any way to get them from StorageCache?

For Less Db Calls.

Feb 23, 2011 at 9:46 AM

No.

StorageCache is just a “Read-only” cache … and to read “check-access” results quickly.