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, d_m_LNK and DataVitalizer
I ran a test here, and noticed that the problem seems to be in the relationship between the Table_E and its children. Table_E is a parent table that connects to four other tables that are its children, in a many to many relationship (*:*). This RLS works perfectly on the child tables, but it doesn't work on the parent table. And I really don't understand why, because the _UserManagement table, which is the table that manages access, has no relationship with any table in my report.
- d_m_LNK1 year agoSuper User
That is interesting, are those relationships bi-directional to the child tables? Maybe that has something to do with it.
I think it would be to your benefit to figure out to how to relate your _UserManagement table to your models and have it do the RLS but that's more based on my experience
- nok1 year agoAdvocate II
Yes, Table_E relates to its four child tables bidirectionally. What I find very strange is that, even when I leave only the TRUE() function in RLS, Table_E still doesn't display any data, but the four child tables display data. Very strange.
And _UserMangement table has no relationship with other tables.