security: CAPA privilege escalation, CSV injection, AI rate-limit, prompt injection guard, open redirect, timing-safe cron secret, server-only admin client, notifications RLS
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- Fix: notifications_log RLS was allowing any hse/admin to read ALL notifications.
|
||||
-- Replace with per-user policy (everyone reads own) + admin-only policy for oversight.
|
||||
|
||||
DROP POLICY IF EXISTS "notifications_read_elevated" ON notifications_log;
|
||||
|
||||
CREATE POLICY "notifications_read_own" ON notifications_log
|
||||
FOR SELECT USING (recipient_user_id = auth.uid());
|
||||
|
||||
CREATE POLICY "notifications_read_admin" ON notifications_log
|
||||
FOR SELECT USING (auth_user_role() = 'admin');
|
||||
Reference in New Issue
Block a user