https://supabase.com/ logo
Allow certain user with specific UID to have full access to my table
c

Cokaps016

05/25/2023, 3:29 AM
This is my RLS policy but it doesn’t work (when I submit while in a session of that specific email - UID). My form doesn't submit anything relate to auth.uid (hmm I only submit the content). Idk if this is the reason why it doesn't work?

https://cdn.discordapp.com/attachments/1111133999436419142/1111133999595794483/image.png

j

Jason Creviston

05/25/2023, 11:22 AM
What's your use-case here? Because there's the
service_role
key, which can be used to create a separate supabase client; and that would bypass RLS.
c

Cokaps016

05/25/2023, 11:43 AM
I mean it’s website for tracking my lifestyle (so only I can edit it and edit it on my phone) while still show data on page for my friend
service role is usually used for back end so I think it doesn’t suit my need?
j

Jason Creviston

05/25/2023, 11:53 AM
Yeah,
service_role
should only be used on server-side code.
c

Cokaps016

05/25/2023, 11:55 AM
So hmm how do I like make this work
I mean a user with a certain on my website should have a full acess (edit,delete,…) to my database
j

Jason Creviston

05/25/2023, 12:08 PM
I assume you're on the right track with the
auth.uid()
, but I'm not an RLS expert.