mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 10:31:13 -05:00
15 lines
487 B
SQL
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); |