From 901f50cb01f774504d9a9524f25059ac55c668da Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 00:52:42 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- ...260428005239_2d5dd166-67e0-4072-b14a-6bad8450ceb2.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 supabase/migrations/20260428005239_2d5dd166-67e0-4072-b14a-6bad8450ceb2.sql diff --git a/supabase/migrations/20260428005239_2d5dd166-67e0-4072-b14a-6bad8450ceb2.sql b/supabase/migrations/20260428005239_2d5dd166-67e0-4072-b14a-6bad8450ceb2.sql new file mode 100644 index 0000000..35960dc --- /dev/null +++ b/supabase/migrations/20260428005239_2d5dd166-67e0-4072-b14a-6bad8450ceb2.sql @@ -0,0 +1,9 @@ +-- Remove overly-permissive public SELECT policy on payment_requests +DROP POLICY IF EXISTS pr_select_public_by_id ON public.payment_requests; + +-- Authenticated users can see payment requests they created, or admins see all +CREATE POLICY pr_select_owner_or_admin +ON public.payment_requests +FOR SELECT +TO authenticated +USING (is_admin(auth.uid()) OR created_by = auth.uid()); \ No newline at end of file