Hey folks, I'm tinkering around with supabase at t...
# help
h
Hey folks, I'm tinkering around with supabase at the moment and I am exploring the RLS, I am wanting users to only access the data they enter into my tables. It is my understanding that for each table I wish to do this, I need to track the
user_id
in the table (with relationship to the auth table) and then have a policy that checks
uid() = user_id_column
Is this correct? Thanks
n
Hello @husK! 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
You don’t have to have a foreign key relationship, RLS policy is like an extra where statement, and the auth functions just return value from the user token that can be compared. You will need the uuid of the user in the table though, if you want to limit to users own data.
n
husK (2022-05-22)
h
Perfect, thanks for the clarification. 🙂
n
Thread was archived by @husK. Anyone can send a message to unarchive it.