How to access user_metadata in RLS policies?
# help
j
How to access user_metadata in RLS policies?
n
Hello @joshcowan25! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
n
joshcowan25 (2022-05-24)
g
You could also do a table select on auth.users with auth.uid()
b
You might also look into this, which I just wrote: https://github.com/supabase-community/supabase-custom-claims
s
You can access it thru
auth.users.raw_user_meta_data->
g
LOL... team effort
b
You'd have to join in the
auth.users
table or do a lookup in order to gain access to it, though.
g
Yes on lookup, but use a stable function so it only runs once