Skip to content
Snippets Groups Projects
Select Git revision
  • 3bffbaedec9568a330524ecb629b61fd9c410230
  • main default
  • detached3
  • detached2
  • modernisation-gestion-donnees
  • detached
  • 1.5.0
  • 1.4.3
  • 1.4.2
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.6
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
  • 0.9.10
  • 0.9.9
  • 0.9.8
26 results

UpdateDataCommand.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    RoleProvider.php 6.14 KiB
    <?php
    
    namespace Application\Provider\Role;
    
    use Application\Entity\Db\Affectation;
    use Application\Entity\Db\Structure as StructureEntity;
    use BjyAuthorize\Provider\Role\ProviderInterface;
    use UnicaenApp\Exception\LogicException;
    use UnicaenApp\Service\EntityManagerAwareInterface;
    use UnicaenApp\Service\EntityManagerAwareTrait;
    use Zend\Permissions\Acl\Role\RoleInterface;
    use Application\Acl\Role;
    use Application\Acl\IntervenantRole;
    
    /**
     * Fournisseur des rôles utilisateurs de l'application :
     * - ceux définis dans la configuration du fournisseur
     *
     *  * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
     */
    class RoleProvider implements ProviderInterface, EntityManagerAwareInterface
    {
        use EntityManagerAwareTrait;
        use \Zend\ServiceManager\ServiceLocatorAwareTrait;
    
        /**
         * @var array
         */
        protected $config = [];
    
        /**
         * @var array
         */
        protected $roles;
    
        /**
         * @var StructureEntity
         */
        protected $structureSelectionnee;
    
    
    
        /**
         * Constructeur.
         * @param array $config
         */
        public function __construct( $config = [] )
        {
            $this->config = $config;
        }
    
        public function init()
        {
            $this->getEntityManager()->getFilters()->enable('historique');
        }
    
        /**
         * @return RoleInterface[]
         */
        public function getRoles()
        {
            if (null === $this->roles) {
                $this->roles = $this->makeRoles();
            }
            return $this->roles;
        }
    
        protected function makeRoles()
        {
            $roles = [];