<?php

namespace Modules\Commande\Rules;

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

class PopupCreationCommande
{
    protected ServerRequestInterface $request;
    protected \PDO $pdo;
        
    /**
     * __construct
     *
     * @param  ServerRequestInterface $request
     * @return void
     */
    public function __construct(ServerRequestInterface  $request, \PDO $pdo)
    {
        $this->request  = $request;
        $this->pdo      = $pdo;
    }
    
    /**
     * init
     *
     * @return bool
     */
    public function init() : bool
    {
        if (Roles::droitsUtilisateur($this->pdo, 'HA_CA_CMV')) {
            return true;
        }
        return false;
    }


    /**
     * @return bool
     */
    public function popupListeDA(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function popupListeligneDA(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function popupListeAO(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function popupListefournisseurAO(): bool
    {
        return true;
    }
}
