mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 06:11:11 -05:00
Add RLS policies for Realtime
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
-- Add RLS policies to enable Realtime for moderation tables
|
||||
|
||||
-- Content Submissions
|
||||
CREATE POLICY "realtime_admin_access_content_submissions"
|
||||
ON public.content_submissions
|
||||
FOR SELECT
|
||||
TO supabase_realtime_admin
|
||||
USING (true);
|
||||
|
||||
CREATE POLICY "moderators_realtime_content_submissions"
|
||||
ON public.content_submissions
|
||||
FOR SELECT
|
||||
TO authenticated
|
||||
USING (check_realtime_access());
|
||||
|
||||
-- Submission Items
|
||||
CREATE POLICY "realtime_admin_access_submission_items"
|
||||
ON public.submission_items
|
||||
FOR SELECT
|
||||
TO supabase_realtime_admin
|
||||
USING (true);
|
||||
|
||||
CREATE POLICY "moderators_realtime_submission_items"
|
||||
ON public.submission_items
|
||||
FOR SELECT
|
||||
TO authenticated
|
||||
USING (check_realtime_access());
|
||||
|
||||
-- Reports
|
||||
CREATE POLICY "realtime_admin_access_reports"
|
||||
ON public.reports
|
||||
FOR SELECT
|
||||
TO supabase_realtime_admin
|
||||
USING (true);
|
||||
|
||||
CREATE POLICY "moderators_realtime_reports"
|
||||
ON public.reports
|
||||
FOR SELECT
|
||||
TO authenticated
|
||||
USING (check_realtime_access());
|
||||
|
||||
-- Reviews
|
||||
CREATE POLICY "realtime_admin_access_reviews"
|
||||
ON public.reviews
|
||||
FOR SELECT
|
||||
TO supabase_realtime_admin
|
||||
USING (true);
|
||||
|
||||
CREATE POLICY "moderators_realtime_reviews"
|
||||
ON public.reviews
|
||||
FOR SELECT
|
||||
TO authenticated
|
||||
USING (check_realtime_access());
|
||||
Reference in New Issue
Block a user