Trying to set up a RLS policy where if a column on...
# help
n
Trying to set up a RLS policy where if a column on another table contains the value NULL for the current user it gets allowed, otherwise it's not but I am having difficulties with setting up the policy. Anyone that can take a look with me?
n
Hello @Nin! 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.
s
You can share the policy you have tried here and it will be easier for others to chime in.
n
Copy code
(( SELECT users.tenant_id
   FROM users
  WHERE (users.user_id = uid())) = NULL::uuid)
This is the query I'm using right now.
Fixed it, instead of "= null::uuid" it should've been "IS NULL"
n
Thread was archived by @Nin. Anyone can send a message to unarchive it.