Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

RLS to Admin Users

Hi Everybody,

Below is my table.

  1. I need help with setting RLS on the 'Company' column from the Company table, to populate respective 'Store' and 'StoreName' values.
  2. The result from 1, to be shown only to 'IsAdmin' users and within that 'Company' from the UserAccess table.

 

Company Table - 

 

Company StoreStore Name
1512251Target
1523250Lowes
1512252IFB
1534250Tyson
1522250HEB

 

UserAccess Table -

UserActiveDirectoryIDCompanyIsAdmin
1421E-A7E51511
24199-BA8B1521
38A27-47E31531
43244-BA8B1510

 

Expected Result for Company '151' -

 

Company StoreStore Name
1512251Target
1512252IFB

 

Expected Result for Company '152' -

 

Company StoreStore Name
1523250Lowes
1522250HEB

 

Appreciate your help. Thanks. Anonymous , MathiasChd , VahidDM , daxer-almighty