mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 06:51:12 -05:00
53 lines
1.1 KiB
SQL
53 lines
1.1 KiB
SQL
-- 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()); |