Proper way to query table for RLS

32 views Asked by At

I'm sure this is a common question but I cannot find the answer. I want to query a separate table called users and check if they have property is_moderator = true.

(EXISTS ( SELECT 1
   FROM users
  WHERE ((users.user_id = auth.uid()) AND (users.is_moderator = true))))

Heres what I have so far

I tried to delete users.user_id = auth.uid() just to check if any users have is_moderator and it still does not work. It's as if it isn't even querying the users table . Any help is appreciated.

0

There are 0 answers