cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sabeensp Member
Member

Row Level Security (RLS)

Hello,

I need to implement RLS.
I have 2 tables (below). Table 1 has all the users with their emails and Title. Table 2 has data which needs to be presented based on RLS, however some records can be viewed by multiple users based on their Titles.  I can create a realtionship between those 2 tables either by ID, Username, or Title.  Thanks in advance.

 

Table 1:

IDNameUsernameTitle
1Johnjohn@xyz.comManager
2Jerryjerry@xyz.comDirector
3Marymary@xyz.comManger
4Suesue@xyz.comAnalyst
5Alexalex@xyz.comDeveloper

 

Table 2

RowidWho can ViewCol1Col2
101Manager/Director  
102Manager/Director  
103Manager/Director  
104Manager/Director  
105Analyst / Developer  
106Everyone  
107Everyone  
108Everyone  
109Everyone  
110Only Director  
111Only Director  
112Only Director  
113Only Manager  

 

5 REPLIES 5
Super User
Super User

Re: Row Level Security (RLS)

@sabeensp  - You could have a bridge table that contains a row for each combination of Table2 RowID and Title. Then, Table1 will filter the Bridge table and the Bridge table will filter Table2.

Hope this helps,

Nathan

sabeensp Member
Member

Re: Row Level Security (RLS)

@natelpeterson Data table has over 10M rows creating mutiple combination would be hard, but thanks for the tip.

Super User
Super User

Re: Row Level Security (RLS)

Is the RLS defined row-by-row for 10M rows? Or is there some other attribute that can be exploited?

sabeensp Member
Member

Re: Row Level Security (RLS)

@natelpetersonOnly Title of the employee

Super User
Super User

Re: Row Level Security (RLS)

The Bridge table could instead be the distinct combinations of Who can View and Title. Then use those two columns in the relationships.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 182 members 2,283 guests
Please welcome our newest community members: