Files
thrilltrack-explorer/supabase/migrations/20251015181416_8351b769-6a25-4893-be6b-d6e3aec3fb8d.sql
2025-10-15 18:14:42 +00:00

15 lines
487 B
SQL

-- Enable RLS on the archive table
ALTER TABLE public.entity_versions_archive ENABLE ROW LEVEL SECURITY;
-- Create RLS policies for the archive table (same as original)
CREATE POLICY "Moderators can view all archived versions"
ON public.entity_versions_archive
FOR SELECT
TO authenticated
USING (is_moderator(auth.uid()));
CREATE POLICY "Public can view current archived versions"
ON public.entity_versions_archive
FOR SELECT
TO authenticated
USING (is_current = true);