Forum Discussion
RLS security not working
- 10 months ago
I was able to solve the issue, I had done everything correctly and the initial user I had testing my data was originally a member of the workspace but I downagraded them to a viewer for for this test because I believed it should not have impacted the RLS as far as I know. However, it never worked for them and they were able to see all data.
So, I found another test subject who was not a member or viewer of the workspace and I shared the report with them, they requested access which I provided and the RLS seem to work just fine for them.
So yeah a weird one but it works!
Thanks,
Ben
HI Ben1981 ,
I think the main reason your RLS isn’t working is because your relationship between Managers → HR Employees is one-way.
RLS filters only propagate across relationships if the direction allows it. Since your current setup is one-way, the filter on the Managers table doesn’t flow down to Employees that’s why your manager sees all employees.
If you can’t change relationship. Use a calculated table or measure to enforce RLS.
Employee_RLS = FILTER('HR Employees', RELATED(Managers[Email Address]) = USERPRINCIPALNAME())
Apply RLS on this new table instead.
This approach ensures the manager only sees their own employees, even with a one-way relationship.
Thanks,
Akhil.