Last active
August 2, 2018 05:12
-
-
Save cazzer/f66d8e1419ffc3bd2e5786f724292106 to your computer and use it in GitHub Desktop.
This file contains 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
create policy item_owner | |
on items | |
as permissive | |
for all | |
to application_user | |
using ( | |
items.acl_read && regexp_split_to_array(current_setting('jwt.claims.roles'), ',')::uuid[] | |
or items.acl_write && regexp_split_to_array(current_setting('jwt.claims.roles'), ',')::uuid[] | |
) | |
with check ( | |
items.acl_write && regexp_split_to_array(current_setting('jwt.claims.roles'), ',')::uuid[] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment