<?php
namespace Modules\Systeme\Rules;

use Helpers\Outil\Roles;
use Psr\Http\Message\ServerRequestInterface;

class Main
{
    /** @var ServerRequestInterFace $request */
    protected ServerRequestInterface $request;
    
    /** @var \PDO $pdo */
    protected \PDO $pdo;
    
    /**
     * @param ServerRequestInterface $request
     * @param \PDO $pdo
     */
    public function __construct(ServerRequestInterface $request, \PDO $pdo)
    {
        $this->request  = $request;
        $this->pdo      = $pdo;
    }
    
    /**
     * @return bool
     */
    public function init(): bool
    {
        if ($_SESSION['Session_Login'] === 'OXAUSER' || Roles::GetALL()) {
            return true;
        }

        return false;
    }
}
