Last active
November 26, 2016 06:15
-
-
Save cazzer/44935f2b8de5d74d8ccc82032fd8734c to your computer and use it in GitHub Desktop.
Row Level Security: Policy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alter table data enable row level security; | |
create policy data_owner | |
on data | |
for all | |
to application_user | |
using ( | |
( | |
select true as bool from ( | |
select data_id from user_data where user_role = current_user | |
) as user_data where data_id = data.id | |
) = true | |
) | |
with check (true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment