From e15705e94db0d278157dd6b2cccca6de2e5a7a0c Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:11:51 +0000 Subject: [PATCH] Fix RLS policy syntax --- ...1137_23c72601-221b-44ed-bfdc-e28136ef802d.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 supabase/migrations/20251003151137_23c72601-221b-44ed-bfdc-e28136ef802d.sql diff --git a/supabase/migrations/20251003151137_23c72601-221b-44ed-bfdc-e28136ef802d.sql b/supabase/migrations/20251003151137_23c72601-221b-44ed-bfdc-e28136ef802d.sql new file mode 100644 index 00000000..206c07c4 --- /dev/null +++ b/supabase/migrations/20251003151137_23c72601-221b-44ed-bfdc-e28136ef802d.sql @@ -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())); \ No newline at end of file