<?php declare(strict_types=1);

namespace Modules\Additional\Specifique\Client112\Modules\Facture\Rules;

use Helpers\Outil\Roles;

class ParamSIContratFournisseur
{
    private int $numClient = 112;

    /**
     * Summary of droits
     * @var array<mixed>
     */
    private array $droits;

    /**
     * Summary of __construct
     * @param \PDO $pdo
     */
    public function __construct(
        private \PDO $pdo,
    ) {
        $this->droits = [
            'HA_PARAM' => Roles::droitsUtilisateur($this->pdo, 'HA_PARAM', $_SESSION["Session_Login"]),
        ];
    }

    public function init(): bool
    {
        return $this->droits['HA_PARAM'] && (\intval($_SESSION['Session_NumClient']) === $this->numClient);
    }
}
