🚀 Auto-deploy: DBMaker atualizado em 27/07/2026 11:16:09

This commit is contained in:
2026-07-27 11:16:09 +00:00
parent 2f8513127a
commit 32dc2f9aab
5 changed files with 115 additions and 145 deletions
+14
View File
@@ -0,0 +1,14 @@
-- 1. Ativar Row Level Security nas tabelas principais
ALTER TABLE steelbook.projetos ENABLE ROW LEVEL SECURITY;
ALTER TABLE steelbook.templates_customizados ENABLE ROW LEVEL SECURITY;
ALTER TABLE steelbook.t_topicos ENABLE ROW LEVEL SECURITY;
-- 2. Criar políticas para permitir apenas usuários autenticados (authenticated)
-- DROP POLICY IF EXISTS "Autenticados podem gerenciar projetos" ON steelbook.projetos;
-- CREATE POLICY "Autenticados podem gerenciar projetos" ON steelbook.projetos
-- FOR ALL USING (auth.role() = 'authenticated');
-- Em vez de FOR ALL, para produção rigorosa pode-se dividir, mas como o app depende do uso direto via painel admin, "ALL" para role authenticated é o mínimo viável seguro hoje.
CREATE POLICY "RLS_Projetos_Auth" ON steelbook.projetos FOR ALL USING (auth.role() = 'authenticated');
CREATE POLICY "RLS_Templates_Auth" ON steelbook.templates_customizados FOR ALL USING (auth.role() = 'authenticated');
CREATE POLICY "RLS_Topicos_Auth" ON steelbook.t_topicos FOR ALL USING (auth.role() = 'authenticated');