Quantcast
Channel: NetSqlAzMan - .NET SQL Authorization Manager
Viewing all articles
Browse latest Browse all 163

New Post: Determine whether role is primary or inherited

$
0
0

 

Hello,

I have been using RoleProvider to determine LDAP roles and authorizations for a given user.  I have been successfully determining all roles and all authorizations for a user, and I see that I can determine whether an item is a member of an Item. 

 

I'm wondering if there is a way to determine, given a role which a user belongs to, whether the user is defined explicitly as a member of this role, or if they are instead a member of the role through inheritance (i.e. the role itself does not specify the user as a member, but instead the role is a child member within another role, in which this user is a 'primary', or explicitly defined user.)

 

Example -

-In Role A, I am an authorized user. 

-Role B is defined as a child role in NetSqlAzMan. 

-I am not listed as an authorized user of Role B, but "roleProvider.GetRolesForUser(username)" returns both of these roles.

If I iterate through these roles, when I am working with Role B, is there a way to determine that I am not directly authorized to this role, but instead granted via inheritance.  Or, vice versa, if I am working with Role A in the foreach, is there a way to determine that I am defined directly as user to this Role?

 

Please let me know if that is unclear.

Thanks!

 

Jason


Viewing all articles
Browse latest Browse all 163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>