fix(portal): permitir superadmin ver portal enfermero y simular agenda

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-30 20:34:27 -05:00
co-authored by Claude Sonnet 4.6
parent 3fa92e8813
commit 1efdc7bbad
+2 -2
View File
@@ -16,11 +16,11 @@ $enfId = (int)($usuario['enfermera_id'] ?? 0);
$enfermeraNombre = $usuario['full_name'] ?? $usuario['username'] ?? 'El profesional de salud';
// Si es admin puede simular ver la agenda de otra enfermera vía ?eid=X
if ($rol === 'admin' && isset($_GET['eid'])) {
if (in_array($rol, ['admin', 'superadmin']) && isset($_GET['eid'])) {
$enfId = (int)$_GET['eid'];
}
if ($rol !== 'admin' && $rol !== 'enfermero') {
if (!in_array($rol, ['admin', 'superadmin', 'enfermero'])) {
header('Location: index.php'); exit;
}