Hello, is their anyway to check a user input filed...
# help
b
Hello, is their anyway to check a user input filed in rls policy. So what I want to achieve is to check in user profile if the location field id matches to a data which is coming from front end. Thanks
n
Hello @Borisdm! 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
Yes RLS policy is just an extra where sql statement that returns true or false/null. You can do selects on other tables and compare against incoming columns on insert/update. https://supabase.com/docs/guides/auth/row-level-security#policies-with-joins
s
You could set this up in on a table trigger, this could happen
before insert
, that way no data would be stored in the database if the validation fails.
b
Thanks