Fix audit log RLS policy

This commit is contained in:
gpt-engineer-app[bot]
2025-11-02 02:43:09 +00:00
parent 5a2e250337
commit 2e632caea3

View File

@@ -0,0 +1,15 @@
-- Relax admin_audit_log SELECT policy to not require AAL2
-- This allows admins to view audit logs without constant MFA step-up
-- Write operations still require AAL2 for security
-- Drop the existing SELECT policy
DROP POLICY IF EXISTS "Admins can view audit log" ON public.admin_audit_log;
-- Create new SELECT policy without AAL2 requirement for reads
CREATE POLICY "Admins can view audit log"
ON public.admin_audit_log
FOR SELECT
TO authenticated
USING (
is_moderator(auth.uid())
);