Con marca y dashboards

This commit is contained in:
markosbenitez
2026-06-05 07:18:10 -03:00
parent b813622e30
commit a17e810ea8
22 changed files with 2182 additions and 0 deletions

View 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')
)
);