<?php
declare(strict_types=1);

namespace App\Middleware;

class AdminMiddleware
{
    public function handle(): bool
    {
        if (!isset($_SESSION['user_id']) || ($_SESSION['role'] ?? '') !== 'admin') {
            http_response_code(403);
            echo 'Acesso restrito ao administrador';
            return false;
        }
        return true;
    }
}
