HI 👋 hopefully a simple query here. My RLS is bas...
# sql
c
HI 👋 hopefully a simple query here. My RLS is based on a user id being in an auth table. If I say
((role() = 'authenticated'::text) AND (uid() = '057b1bc4-b79b-46ae'::uuid))
it works but if i say
((role() = 'authenticated'::text) AND (uid() IN ( SELECT admin.user_uuid FROM admin)))
it doesnt work there is a row with that user_uuid in the admin table. Can anyone see what im doing wrong? thanks!
g
Do you have RLS on the admin table that would stop the user from selecting it?
c
That's an interesting point! Will check it out. Thanks
m
Just a side note I think
(role() = 'authenticated'::text)
redundant
c
The issue was resolved by making the admin table accessible