Skip to content

Instantly share code, notes, and snippets.

@cazzer
Last active August 2, 2018 05:25
Show Gist options
  • Save cazzer/b4d9d575311bf54a4709c7eaac56ef0d to your computer and use it in GitHub Desktop.
Save cazzer/b4d9d575311bf54a4709c7eaac56ef0d to your computer and use it in GitHub Desktop.
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