ivanq3w
08/20/2021, 6:58 PMcreate policy "Only CUSTOM_ROLE can create posts" on posts for
select using (auth.role() = 'CUSTOM_ROLE');
How to change role column in auth.users ?ivanq3w
08/20/2021, 7:44 PM(
EXISTS (
SELECT *
FROM
users
WHERE
(
(users.id = uid())
AND ((users.role):: text = 'ADMIN':: text)
)
)
)
Need public.users table with the same id as in auth.users.
https://supabase.io/docs/guides/auth/managing-user-data
But why we need to stuff like this?
Why not do it like in Hasura? User role is added to JWT claim?
@Userivanq3w
08/20/2021, 7:51 PMivanq3w
08/20/2021, 7:52 PM