Con marca y dashboards
This commit is contained in:
19
supabase/migrations/20260605093949_rls_deny_sensitive.sql
Normal file
19
supabase/migrations/20260605093949_rls_deny_sensitive.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- ============================================================
|
||||
-- Migration 010: RLS deny sensitive questions
|
||||
-- Niega SELECT sobre answers donde el código de pregunta es 3.4 (salario)
|
||||
-- o 7.1 (texto libre) a todos los roles no-superuser.
|
||||
-- Defensa en profundidad: las RPC ya excluyen estos códigos, pero esta
|
||||
-- política los bloquea también en consultas directas.
|
||||
-- Los service_role y postgres (superuser) no están afectados (bypasan RLS).
|
||||
-- ============================================================
|
||||
CREATE POLICY "deny_sensitive_answers"
|
||||
ON public.answers
|
||||
AS RESTRICTIVE
|
||||
FOR SELECT
|
||||
TO anon, authenticated
|
||||
USING (
|
||||
question_id NOT IN (
|
||||
SELECT q.id FROM public.questions q
|
||||
WHERE q.code IN ('3.4', '7.1')
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user