I’m trying to create a service for clubs that creates gatherings.
So, I made tables such as users, clubs, and members that join.
I configured RLS (Row-Level Security) as follows so that the club is only exposed to users belonging to the clubs, and it works well.
(EXISTS (SELECT 1
FROM memberships
WHERE ((memberships.club_id = clubs.club_id) AND (memberships.user_id = auth.uid()))))
However, the problem is that once this is applied to clubs table, inserting a row into the clubs table doesn’t work.
Even after additionally setting up RLS for all or authenticated users for the purpose of inserting, it still doesn’t work.
Please help me.
(EXISTS (SELECT 1
FROM memberships
WHERE ((memberships.club_id = clubs.club_id) AND (memberships.user_id = auth.uid()))))
I applied above to RLS on clubs table.
but i can’t make new row on clubs table.
so, tried so many RLS on insert section .
but it failed.
please help me.
Jason Goo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.