<?php

namespace App\Middlewares;

class UgelMiddleware
{
    public function handle() {

        if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'UGEL') {
            $_SESSION['message'] = "No tienes permisos para acceder a esta ruta.";
            $_SESSION['message_type'] = "danger";
            header("Location: " . BASE_HEADER . "dashboard");
            exit;
        }
    }
}