Last active
August 2, 2018 05:25
-
-
Save cazzer/b4d9d575311bf54a4709c7eaac56ef0d 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 view items_view | |
with (security_barrier) | |
as | |
select items.* | |
from items | |
join permissions on item_id = items.id | |
and user_or_group_id = | |
any(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