RLS How to read using join on column value?
Hello! I have two schemas,
This is the
I want to create an RLS policy on the messages table for
This is what I have
But how can I use my RPC function to match up with the valid
Basically, I want to check that the only messages a user is getting is one where they are in that room.
Any ideas?
messages and rooms.This is the
rooms schemas:messages schema:I want to create an RLS policy on the messages table for
SELECT such that a user can only read messages for which they are either part of from_user_id to to_user_id.This is what I have
But how can I use my RPC function to match up with the valid
room_idBasically, I want to check that the only messages a user is getting is one where they are in that room.
Any ideas?