Forum Discussion
Dynamic RLS and all access
- 3 years ago
I think the short answer is, yes, you have to add a "No RLS" security group to put them in. Make sure that anyone you have in "No RLS" is not also in any other RLS group.
There is a longer answer if your scenario is:
- you are adding all users (via distribution list email, security group, etc.) to a single dynamic RLS group that leverages USERNAME/USERPRINCIPALNAME against a Users table
AND - your Users table only includes people with some kind of restriction, but people who are in the RLS group but not in the Users table should see all rows
In this case, you can create a measure that returns TRUE if the current user is NOT in the Users table, and then just add that to your RLS conditions with an OR.
Example:
Say you have a simple dynamic RLS model like so:
With RLS set up like this:
Then you can create the following measure:
Super User Check = CALCULATE( ISEMPTY( Users ), TREATAS( { USERPRINCIPALNAME() }, Users[User] ), REMOVEFILTERS( Users ) )And update your RLS accordingly:
Remember, everyone still needs to be added to Dyn RLS in your dataset security settings on the service.
- you are adding all users (via distribution list email, security group, etc.) to a single dynamic RLS group that leverages USERNAME/USERPRINCIPALNAME against a Users table
I think the short answer is, yes, you have to add a "No RLS" security group to put them in. Make sure that anyone you have in "No RLS" is not also in any other RLS group.
There is a longer answer if your scenario is:
- you are adding all users (via distribution list email, security group, etc.) to a single dynamic RLS group that leverages USERNAME/USERPRINCIPALNAME against a Users table
AND - your Users table only includes people with some kind of restriction, but people who are in the RLS group but not in the Users table should see all rows
In this case, you can create a measure that returns TRUE if the current user is NOT in the Users table, and then just add that to your RLS conditions with an OR.
Example:
Say you have a simple dynamic RLS model like so:
With RLS set up like this:
Then you can create the following measure:
Super User Check =
CALCULATE(
ISEMPTY( Users ),
TREATAS( { USERPRINCIPALNAME() }, Users[User] ),
REMOVEFILTERS( Users )
)
And update your RLS accordingly:
Remember, everyone still needs to be added to Dyn RLS in your dataset security settings on the service.
- Anonymous3 years agoNot applicable
Thank you!
The simple answer worked for me! I added a group called "All access" that doesn't have a relationship. Users i put in there showed all data.
Appreciate the help!