From 553efb003bc266b5d3bfca3505f0d8f5e4f056d9 Mon Sep 17 00:00:00 2001 From: VPS 4 Builder Date: Tue, 23 Jun 2026 17:49:36 +0200 Subject: [PATCH] =?UTF-8?q?fix(rbac):=20exp=C3=B5e=20PR=C3=93TESES=20e=20C?= =?UTF-8?q?ONTRATOS=20no=20editor=20de=20cargos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PAGINAS_RBAC não listava 'proteses' nem 'contratos', então essas páginas não eram concedíveis por nenhum cargo (nem via "MARCAR TODAS"/GERENTE, que derivam de TODAS_PAGINAS = flatMap de PAGINAS_RBAC). Resultado: era impossível um dono dar acesso à área de Prótese a um funcionário pela interface. Adiciona ambas ao grupo ATENDIMENTO e inclui proteses/lancar-gto nos templates RECEPÇÃO e AUXILIAR (alinhado ao papel de Treatment Coordinator). Co-Authored-By: Claude Opus 4.8 --- frontend/views/GestaoEquipeView.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/views/GestaoEquipeView.tsx b/frontend/views/GestaoEquipeView.tsx index 6218276..db932ec 100644 --- a/frontend/views/GestaoEquipeView.tsx +++ b/frontend/views/GestaoEquipeView.tsx @@ -62,7 +62,9 @@ const PAGINAS_RBAC: Array<{ grupo: string; itens: Array<{ key: string; label: st { key: 'pacientes', label: 'PACIENTES' }, { key: 'ortodontia', label: 'ORTODONTIA' }, { key: 'tratamentos', label: 'TRATAMENTOS' }, + { key: 'proteses', label: 'PRÓTESES' }, { key: 'orcamentos', label: 'ORÇAMENTOS' }, + { key: 'contratos', label: 'CONTRATOS' }, { key: 'rx-radiografias', label: 'RX / RADIOGRAFIAS' }, ], }, @@ -94,8 +96,8 @@ const TODAS_PAGINAS = PAGINAS_RBAC.flatMap(g => g.itens.map(i => i.key)); // Modelos de cargo prontos (acelera a configuração). const TEMPLATES_CARGO: Array<{ nome: string; nivel: number; permissoes: string[] }> = [ - { nome: 'RECEPÇÃO', nivel: 10, permissoes: ['dashboard', 'agenda', 'pacientes', 'leads', 'orcamentos'] }, - { nome: 'AUXILIAR / ASB', nivel: 20, permissoes: ['dashboard', 'agenda', 'pacientes', 'ortodontia', 'tratamentos'] }, + { nome: 'RECEPÇÃO', nivel: 10, permissoes: ['dashboard', 'agenda', 'pacientes', 'leads', 'orcamentos', 'contratos', 'lancar-gto', 'proteses'] }, + { nome: 'AUXILIAR / ASB', nivel: 20, permissoes: ['dashboard', 'agenda', 'pacientes', 'ortodontia', 'tratamentos', 'proteses'] }, { nome: 'FINANCEIRO', nivel: 30, permissoes: ['dashboard', 'pacientes', 'financeiro', 'relatorios', 'lancar-gto'] }, { nome: 'GERENTE', nivel: 50, permissoes: [...TODAS_PAGINAS] }, ];