سامانه صدور فاکتور و حسابداری
fix(phase1a): allow authenticated invoker triggers to read org guard mode while denying anon
davoodmehraban89 committed
Oct 16, 2026 at 16:52 UTC
fd941b6896b1566003f3059a1c6a62fca319ea1d
1 file changed
+1
supabase/migrations/20261016101000_phase1a_guard_modes_audit.sql
+1
@@ -32,6 +32,7 @@ RETURNS void LANGUAGE plpgsql SECURITY DEFINER SET search_path='' AS $a$
32
BEGIN PERFORM private.finora_phase1a_audit_event(p_org,p_voucher,auth.uid(),'guard_violation',p_message,jsonb_build_object('sqlstate',p_state)); END $a$;
33
REVOKE ALL ON FUNCTION private.finora_phase1a_audit_immutable() FROM PUBLIC,anon,authenticated;
34
REVOKE ALL ON FUNCTION private.finora_phase1a_mode(uuid) FROM PUBLIC,anon;
35
+GRANT EXECUTE ON FUNCTION private.finora_phase1a_mode(uuid) TO authenticated;
36
REVOKE ALL ON FUNCTION private.finora_phase1a_audit_event(uuid,text,uuid,text,text,jsonb) FROM PUBLIC,anon,authenticated;
37
REVOKE ALL ON FUNCTION private.finora_phase1a_log_guard(uuid,text,text,text) FROM PUBLIC,anon;
38
GRANT EXECUTE ON FUNCTION private.finora_phase1a_log_guard(uuid,text,text,text) TO authenticated;