I want to configure RLS in a way that a user can o...
# help
n
I want to configure RLS in a way that a user can only see rows that they explicitly select with the id For example
Copy code
sql
-- should return nothing
select * from connections 

-- should return the row where id = 1234
select * from connections where id = 1234
I know that I can compare things like the auth data (auth.email() for example) to values, but is that also possible with where parameters?
n
Hello @Nander! 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
No you will need to do an rpc function that requires the parameter.
n
Nander (2022-05-09)
n
thanks for the reply! rpc doesnt work with realtime does it? I want to set up a database for hosting WebRTC connection offers/answers. Listening to answers in real-time would be really beneficial for the host. Though, I'm kinda worried that the sdp that is saved in the database might contain sensitive data, which is why I want to implement this kind of RLS
g
realime triggers on the Postgres tables inserts/deletes/updates. Not sure what rpc doing a select like you show would impact things. rpc has to meet all RLS rules unless you use "security definer" for the function type.
n
hmm alright
thanks a lot
n
Thread was archived by @Nander. Anyone can send a message to unarchive it.