<?php

namespace Core\Middleware;

use Core\Auth;
use Core\Response;

class SuperAdminMiddleware implements MiddlewareInterface
{
    public function handle(string $uri, string $method, array $params)
    {
        $user = Auth::user();
        if ($user && $user['role'] === 'super_admin') {
            return true;
        }
        Response::abort(403);
        return false;
    }
}
