<?php
session_start();
include("../../conexion.php");

if (!isset($_SESSION['usuario']) || !isset($_SESSION['rol'])) {
    header("Location: /index.html");
    exit;
}

$roles_permitidos = ['admin', 'super_admin'];
if (!in_array($_SESSION['rol'], $roles_permitidos)) {
    header("Location: /admin/dashboard.html");
    exit;
}
?>
