How can I create an RLS policy for `auth.uid()` is...
# sql
d
How can I create an RLS policy for
auth.uid()
is
user_id_one
OR
user_id_two
g
If you have constants and only 2 then auth.uid() = u_one OR auth.uid() = u.two. You probably could also use auth.uid() IN (u_one, u_two)
d
Beautiful. It's the same thing as a normal check then
g
RLS policy is just an added WHERE statement returning true or false/null. You can use selects on other tables, functions, etc... just need to think about performance though if you get complicated as it will run on each row during a select policy.