I know by default that when you use the supabase c...
# help
u
I know by default that when you use the supabase client with public api key... you can do joins example is User table -> Account Table
n
Hello @__ianjasper! 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.
u
The problem with this i dont want anyone from the app do the join operation and retrieve the account table (in case of if the use doesn't own the record)
i think this goes to both postgrest and pggraph
I want to secure the account table from unauthorized access
g
What you seem to describe is a basic RLS situation where you would lock the account table with select policy for only user_id record matching auth.uid().
n
__ianjasper (2022-05-26)
u
if ever, can you lock certain field?
Does supabase can handle things like for example in user table you have an email field then always omit in returned response in client? i just want to think that i dont want to expose the email value depends on the role. (maybe if not an admin)
anything under the user will be returned
omit email field (as security) if not an admin role
g
Probably the easiest thing to do is put the "secure" columns in another table. Postgres does have column security but it is based on Postgres roles and not auth. Views can also not show a column. You can also block the table with RLS and then use an rpc call to a security definer function to just return the rest of the row.