mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 18:11:13 -05:00
Fix RLS policy syntax
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
-- Add RLS policies for locations table to allow moderators to INSERT and UPDATE
|
||||||
|
-- This is needed for location creation during park approval
|
||||||
|
|
||||||
|
-- Moderators can insert locations during submission approval
|
||||||
|
CREATE POLICY "Moderators can insert locations"
|
||||||
|
ON public.locations
|
||||||
|
FOR INSERT
|
||||||
|
TO authenticated
|
||||||
|
WITH CHECK (is_moderator(auth.uid()));
|
||||||
|
|
||||||
|
-- Moderators can update locations
|
||||||
|
CREATE POLICY "Moderators can update locations"
|
||||||
|
ON public.locations
|
||||||
|
FOR UPDATE
|
||||||
|
TO authenticated
|
||||||
|
USING (is_moderator(auth.uid()));
|
||||||
Reference in New Issue
Block a user