Forum Discussion
RLS not working for only one table
- 1 year ago
I managed to solve this issue by doing a workaround because for some reason RLS doesn't seem to work with bidirectional many-to-many relationships. That was the problem. So to "solve" this, I needed to create a bridge table with two columns: one for the distinct ID that would relate to all the other tables, and another for the RLS Code. Then I applied RLS only to this bridge table, and it worked.
Hi nok
Your RLS looks mostly good, from my perspective hereβs why Table_E might not be showing data:
- Double-check that the RLS_AccessCode column is exactly right in Table_E same name, type, and values that match _UserManagement.
- Make sure Table_E has the right links or data to work with the filters.
- Try this quick test to see if Admin access works by itself:
var _User = USERPRINCIPALNAME()
var _Access = MAXX(FILTER('_UserManagement', '_UserManagement'[Email] = _User), '_UserManagement'[Type])
RETURN IF(_Access = "Admin", TRUE(), FALSE())
If you get data now as Admin, then the issue is with the permission matching.
Did it work? π A kudos would be appreciated
π¨ Mark it as a solution to help spread knowledge π‘
- nok1 year agoAdvocate II
Hi, DataVitalizer . Thanks for the reply!
1. I checked everything, and the RLS_AccessCode column is the same as all the others.
2. Table_E (like all the other tables in my report) doesn't have a direct relationship with _UserManagement. The "connection" between them is only made in the RLS code. Is this a problem?
3. I used this code, but the data still doesn't appear for Table_E9. Even when I delete all the RLS code from this table and leave only the TRUE() function, it doesn't work, and no data from this table appears. Very weird.- DataVitalizer1 year agoSuper User
nokI suggest temporarily create a new table visual with just Table_E[PrimaryKey] or any non-filtered column and:
- Remove all filters, all visuals, all slicers.
- Use no measures, just raw data.
- Apply TRUE() in RLS role.
- Preview as Admin.
If that doesn't work then the table is not showing because of something structural in the model, not because of RLS filtering logic.
Did it work? π A kudos would be appreciated
π¨ Mark it as a solution to help spread knowledge π‘