In the past I have implemented Row level security in Oracle and SQL Server databases using the security policies and predicate functions.
Now my organization is moving to Amazon Redshift as the data warehouse, looking for inputs on ways to implement RLS in Redshift for raw sql access by users.
example: table A has data for many regions. Columns "REGION" in table contains the region for which the row corresponds to. In the user_setup table, each user has the list of regions to which user should have access to.
table A:
account ID balance region
1 100 AUS
2 120 IND
3 50 EUR
table user_setup:
user region
Usr1 AUS
Usr2 AUS
Usr2 EUR
result expected: if Usr1 executes select * from A; Output should be:
account ID balance region
1 100 AUS
if Usr2 executes select * from A; Output should be:
account ID balance region
1 100 AUS
3 50 EUR
if Usr3 executes select * from A; Output should be: No rows returned.