Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all articles
Browse latest Browse all 12749

Sitecore Security - Role Combination

$
0
0

Is there a way to combine access rights for a Sitecore item?

For example, I have a page that I would like to lock down to users who are a member of two different roles rather than just just one, and a user who has just one of the roles should be denied access.

I know you can have roles within roles but wondering if there was a simpler way to achieve this?

I'm using Sitecore 7.2.

If you are trying to check this in code, you can easily do so using

var user = AuthenticationManager.GetActiveUser(); return user.IsInRole("Role1") && user.IsInRole("Role2") ? "Granted":"Denied";

But if you are trying to achieve this in Sitecore Security on an item, then an AND of those 2 roles will be assigned. Ex: If I allow access to an item in Role1 but deny in Role2, the user with Roles 1 and 2 will have his/her access denied.


Viewing all articles
Browse latest Browse all 12749

Trending Articles