Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

RLS for multiple tables/filters

Hello:

 

We have a multi-tenant database that we're implementing RLS for.  When a user logs in, they belong to only 1 'tenant' and we want to filter out the data, as well as the available values in the filters so they only see their data. 

 

I've set it up in the image below (typical star-schema), and I set up a role on the 'Users' tables where the email_address = usernameprincipal(), and it is filtering the data correctly.

 

However, the issue I'm running into is when other dimensions are in the filters pane it's showing all the values.  For example, when the "Hotel" table is in the filters pane, it is listing all the avialable hotels, not just the ones that belong to that user  (when I use Hotel in a visual like a matrix, it shows correctly)  

 

Do I need to add another table and then role to the 'Hotel' table in order for it to display only the correct hotels?  Right now, I only added a role against the 'Tenant' table.  It's working correctly and as I'd expect for Tenant, just not for Hotel.  There will be other tables (in addition to Hotel) that I'd need to behave similarly only display the values for that tenant.

 

Any help or ideas is greatly appreciated!

 

5 Replies