Writing RLS policy with join
I'm trying to put together a RLS policy to only allow users enrolled in a course to view the discussions. There are two tables for the discussions, one with top-level threads and one with the replies.
Writing a policy for the reply table, I want to make sure only users who are enrolled in the course can select the replies, however there is no
Writing a policy for the reply table, I want to make sure only users who are enrolled in the course can select the replies, however there is no
course_id column in this table. There is however a thread_id which further references course_id. How can I make something like the following policy work?