fase 2.1: roles editables (modelo skeen.role) y permisos por accion (43 claves, 9 grupos) con enforcement en backend y gating en frontend; editor de roles/permisos/menus en Configuracion

This commit is contained in:
2026-10-11 07:32:29 +00:00
parent 75736967ef
commit 28a690aa0f
24 changed files with 1637 additions and 157 deletions

View File

@@ -122,7 +122,7 @@ const CRITICAL_ALERTS: { key: keyof Patient; label: string }[] = [
];
const Pacientes: FC = () => {
const { brand } = useAuth();
const { brand, can } = useAuth();
const { term } = useGlosario();
const { labelFor: branchLabel } = useSucursales();
const [patients, setPatients] = useState<Patient[]>([]);
@@ -525,7 +525,8 @@ const Pacientes: FC = () => {
return (
<Layout title={term('patient_plural')} subtitle="Directorio de pacientes">
<PageHeader title={term('patient_plural')} subtitle="Busca, crea y gestiona pacientes">
<Button variant="outline" onClick={exportPatients} loading={exporting} disabled={patients.length === 0}>
<Button variant="outline" onClick={exportPatients} loading={exporting} disabled={patients.length === 0 || !can('pacientes.exportar')}
title={can('pacientes.exportar') ? undefined : 'Sin permiso para exportar'}>
<Download size={16} className="mr-2" />
Exportar CSV
</Button>