Forum Discussion
RLS upside-down
- 4 years ago
Assuming you have an existing RLS role that is working the way you want and all you need to do is to give one of your users access to all the data. Then all you would need to do is to create a second role in your model with no restrictions or filters then add the user to this role. The permissions in roles are unioned together so this should grant unlimited access even if the user is also in the RLS role.
hi Greg_Deckler ,
This way 1 user will see the data based on his/her role, but the others will see all the data. What I need is exactly the opposite.
Maria_Maria Would need to understand your data to be more specific. But, in theory, create an Enter Data query with your users' UPN's that need to see all the data. Create an RLS rule like counting the rows in that table that match the UPN. If > 0 then return "true" to see all data, otherwise implement your RLS restriction. It's really kind of impossible to be more specific without knowing your data model and what you are trying to restrict.