Hi all, I’m new to Postgres policies and I’m tryin...
# help
j
Hi all, I’m new to Postgres policies and I’m trying to figure out if a specific RLS policy is even possible and I can’t seem to find any documentation on it. In Firebase, I was able to prevent listing all documents in a collection and only allow retrieving a specific document via the document id. Id like to do that in Supabase as well. All requests will come from unauthenticated users so everything will be using the anon key, but I’d like to be able to prevent a select * and only allow people to select where the id column is equal to a specific value (a device’s uuid). Essentially I need them to have a valid uuid in order to retrieve anything from the table. Can anyone point me in the right direction?
n
Hello @jrstnly! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! 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 have to RLS lockdown the table and then use a security definer rpc call to fetch and return the record.
n
jrstnly (2022-04-20)