RLS policy help
Hi everyone!
I'm trying to write RLS policies to only allow access to rows of a "vendors" table that are identified in a "vendor_communities" table as belonging to the same community as the active user as determined by the "user_communities" table. Here's what I have:
These are not working as expected in that they don't grant access when the desired conditions are met. Thanks to Supabase's new user impersonator feature I can confirm that this is a problem with the policies and not something on the front end.
I have another table with similar requirements but an added user role check that's also not working as expected, I suspect for the same reason. Any help would be appreciated!
Thanks,
GD
I'm trying to write RLS policies to only allow access to rows of a "vendors" table that are identified in a "vendor_communities" table as belonging to the same community as the active user as determined by the "user_communities" table. Here's what I have:
These are not working as expected in that they don't grant access when the desired conditions are met. Thanks to Supabase's new user impersonator feature I can confirm that this is a problem with the policies and not something on the front end.
I have another table with similar requirements but an added user role check that's also not working as expected, I suspect for the same reason. Any help would be appreciated!
Thanks,
GD