We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ece48a1 commit 6f873abCopy full SHA for 6f873ab
1 file changed
supabase/migrations/20250905164249_76c0cbcd-164c-49e1-bb83-774b86da957d.sql
@@ -0,0 +1,22 @@
1
+-- Add remaining policies for billing_records security
2
+
3
+-- System can create billing records (for automated processing)
4
+CREATE POLICY "System can create billing records"
5
+ON public.billing_records
6
+FOR INSERT
7
+TO authenticated
8
+WITH CHECK (auth.uid() = user_id);
9
10
+-- Allow limited updates (only status field changes)
11
+CREATE POLICY "Users can update billing record status only"
12
13
+FOR UPDATE
14
15
+USING (auth.uid() = user_id);
16
17
+-- No deletion of billing records for audit trail integrity
18
+CREATE POLICY "Billing records cannot be deleted"
19
20
+FOR DELETE
21
22
+USING (false);
0 commit comments