Loading module/Application/config/merged/activite.config.php.old −363 File deleted. Show changes module/Application/config/merged/agent.config.php +11 −2 Changes for module/Application/config/merged/agent.config.php: 11 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -94,6 +94,17 @@ return [ AgentPrivileges::AGENT_INDEX, ], ], [ 'controller' => AgentController::class, 'action' => [ 'afficher', ], 'privileges' => [ AgentPrivileges::AGENT_AFFICHER, ], // 'assertion' => AgentAssertion::class, ], [ 'controller' => AgentController::class, 'action' => [ Loading @@ -102,8 +113,6 @@ return [ 'rechercher-with-structure-mere', 'rechercher-responsable', 'rechercher-gestionnaire', 'afficher', ], 'privileges' => [ AgentPrivileges::AGENT_AFFICHER, Loading module/Application/src/Application/Assertion/AgentAffichageAssertion.php +6 −5 Changes for module/Application/src/Application/Assertion/AgentAffichageAssertion.php: 6 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ use Application\Provider\Privilege\AgentaffichagePrivileges; use Application\Provider\Role\RoleProvider as AppRoleProvider; use Application\Service\Agent\AgentServiceAwareTrait; use Application\Service\AgentAffectation\AgentAffectationServiceAwareTrait; use Application\Service\AgentAutorite\AgentAutoriteServiceAwareTrait; use Application\Service\AgentSuperieur\AgentSuperieurServiceAwareTrait; use Structure\Provider\Role\RoleProvider as StructureRoleProvider; use Structure\Service\Structure\StructureServiceAwareTrait; use UnicaenPrivilege\Assertion\AbstractAssertion; Loading @@ -18,6 +20,8 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; class AgentAffichageAssertion extends AbstractAssertion { use AgentServiceAwareTrait; use AgentAutoriteServiceAwareTrait; use AgentSuperieurServiceAwareTrait; use AgentAffectationServiceAwareTrait; use StructureServiceAwareTrait; use UserServiceAwareTrait; Loading @@ -42,13 +46,11 @@ class AgentAffichageAssertion extends AbstractAssertion } $isResponsable = false; $isGestionnaire = false; $isSuperieur = false; $isAutorite = false; if ($role->getRoleId() === StructureRoleProvider::RESPONSABLE) $isResponsable = $this->getStructureService()->isResponsableS($structures, $agent); if ($role->getRoleId() === StructureRoleProvider::GESTIONNAIRE) $isGestionnaire = $this->getStructureService()->isGestionnaireS($structures, $agent); if ($role->getRoleId() === Agent::ROLE_SUPERIEURE) $isSuperieur = $entity->hasSuperieurHierarchique($agent); if ($role->getRoleId() === Agent::ROLE_AUTORITE) $isAutorite = $entity->hasAutoriteHierarchique($agent); if ($role->getRoleId() === Agent::ROLE_SUPERIEURE) $isSuperieur = $this->getAgentSuperieurService()->isSuperieur($entity,$agent); if ($role->getRoleId() === Agent::ROLE_AUTORITE) $isAutorite = $this->getAgentAutoriteService()->isAutorite($entity,$agent); switch ($privilege) { case AgentaffichagePrivileges::AGENTAFFICHAGE_COMPTE : Loading @@ -66,7 +68,6 @@ class AgentAffichageAssertion extends AbstractAssertion case StructureRoleProvider::RESPONSABLE: return $isResponsable; case StructureRoleProvider::GESTIONNAIRE: return $isGestionnaire; case Agent::ROLE_SUPERIEURE: return $isSuperieur; case Agent::ROLE_AUTORITE: Loading module/Application/src/Application/Assertion/AgentAffichageAssertionFactory.php +8 Changes for module/Application/src/Application/Assertion/AgentAffichageAssertionFactory.php: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ namespace Application\Assertion; use Application\Service\Agent\AgentService; use Application\Service\AgentAffectation\AgentAffectationService; use Application\Service\AgentAutorite\AgentAutoriteService; use Application\Service\AgentSuperieur\AgentSuperieurService; use Interop\Container\ContainerInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; Loading @@ -23,11 +25,15 @@ class AgentAffichageAssertionFactory { { /** * @var AgentService $agentService * @var AgentAutoriteService $agentAutoriteService * @var AgentSuperieurService $agentSuperieurService * @var AgentAffectationService $agentAffectationService * @var StructureService $structureService * @var UserService $userService */ $agentService = $container->get(AgentService::class); $agentAutoriteService = $container->get(AgentAutoriteService::class); $agentSuperieurService = $container->get(AgentSuperieurService::class); $agentAffectationService = $container->get(AgentAffectationService::class); $structureService = $container->get(StructureService::class); $userService = $container->get(UserService::class); Loading @@ -35,6 +41,8 @@ class AgentAffichageAssertionFactory { /** @var AgentAssertion $assertion */ $assertion = new AgentAssertion(); $assertion->setAgentService($agentService); $assertion->setAgentAutoriteService($agentAutoriteService); $assertion->setAgentSuperieurService($agentSuperieurService); $assertion->setAgentAffectationService($agentAffectationService); $assertion->setStructureService($structureService); $assertion->setUserService($userService); Loading module/Application/view/application/index/partial/agents.phtml +3 Changes for module/Application/view/application/index/partial/agents.phtml: 3 added lines, 0 removed lines. Original line number Diff line number Diff line <?php use Application\Entity\Db\Agent; use Application\Provider\Privilege\AgentPrivileges; /** * @var Agent[] $agents Loading Loading @@ -46,10 +47,12 @@ Voue êtes responsable de <?php echo count($agents); ?> agent·es. <?php endforeach; ?> </td> <td class="action"> <?php if ($this->isAllowed($agent, AgentPrivileges::AGENT_AFFICHER)) : ?> <a href="<?php echo $this->url('agent/afficher', ['agent' => $agent->getId()], [], true); ?>"> <span class="icon icon-user"></span> Afficher </a> <?php endif; ?> </td> </tr> <?php endforeach; ?> Loading Loading
module/Application/config/merged/agent.config.php +11 −2 Changes for module/Application/config/merged/agent.config.php: 11 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -94,6 +94,17 @@ return [ AgentPrivileges::AGENT_INDEX, ], ], [ 'controller' => AgentController::class, 'action' => [ 'afficher', ], 'privileges' => [ AgentPrivileges::AGENT_AFFICHER, ], // 'assertion' => AgentAssertion::class, ], [ 'controller' => AgentController::class, 'action' => [ Loading @@ -102,8 +113,6 @@ return [ 'rechercher-with-structure-mere', 'rechercher-responsable', 'rechercher-gestionnaire', 'afficher', ], 'privileges' => [ AgentPrivileges::AGENT_AFFICHER, Loading
module/Application/src/Application/Assertion/AgentAffichageAssertion.php +6 −5 Changes for module/Application/src/Application/Assertion/AgentAffichageAssertion.php: 6 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ use Application\Provider\Privilege\AgentaffichagePrivileges; use Application\Provider\Role\RoleProvider as AppRoleProvider; use Application\Service\Agent\AgentServiceAwareTrait; use Application\Service\AgentAffectation\AgentAffectationServiceAwareTrait; use Application\Service\AgentAutorite\AgentAutoriteServiceAwareTrait; use Application\Service\AgentSuperieur\AgentSuperieurServiceAwareTrait; use Structure\Provider\Role\RoleProvider as StructureRoleProvider; use Structure\Service\Structure\StructureServiceAwareTrait; use UnicaenPrivilege\Assertion\AbstractAssertion; Loading @@ -18,6 +20,8 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; class AgentAffichageAssertion extends AbstractAssertion { use AgentServiceAwareTrait; use AgentAutoriteServiceAwareTrait; use AgentSuperieurServiceAwareTrait; use AgentAffectationServiceAwareTrait; use StructureServiceAwareTrait; use UserServiceAwareTrait; Loading @@ -42,13 +46,11 @@ class AgentAffichageAssertion extends AbstractAssertion } $isResponsable = false; $isGestionnaire = false; $isSuperieur = false; $isAutorite = false; if ($role->getRoleId() === StructureRoleProvider::RESPONSABLE) $isResponsable = $this->getStructureService()->isResponsableS($structures, $agent); if ($role->getRoleId() === StructureRoleProvider::GESTIONNAIRE) $isGestionnaire = $this->getStructureService()->isGestionnaireS($structures, $agent); if ($role->getRoleId() === Agent::ROLE_SUPERIEURE) $isSuperieur = $entity->hasSuperieurHierarchique($agent); if ($role->getRoleId() === Agent::ROLE_AUTORITE) $isAutorite = $entity->hasAutoriteHierarchique($agent); if ($role->getRoleId() === Agent::ROLE_SUPERIEURE) $isSuperieur = $this->getAgentSuperieurService()->isSuperieur($entity,$agent); if ($role->getRoleId() === Agent::ROLE_AUTORITE) $isAutorite = $this->getAgentAutoriteService()->isAutorite($entity,$agent); switch ($privilege) { case AgentaffichagePrivileges::AGENTAFFICHAGE_COMPTE : Loading @@ -66,7 +68,6 @@ class AgentAffichageAssertion extends AbstractAssertion case StructureRoleProvider::RESPONSABLE: return $isResponsable; case StructureRoleProvider::GESTIONNAIRE: return $isGestionnaire; case Agent::ROLE_SUPERIEURE: return $isSuperieur; case Agent::ROLE_AUTORITE: Loading
module/Application/src/Application/Assertion/AgentAffichageAssertionFactory.php +8 Changes for module/Application/src/Application/Assertion/AgentAffichageAssertionFactory.php: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ namespace Application\Assertion; use Application\Service\Agent\AgentService; use Application\Service\AgentAffectation\AgentAffectationService; use Application\Service\AgentAutorite\AgentAutoriteService; use Application\Service\AgentSuperieur\AgentSuperieurService; use Interop\Container\ContainerInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; Loading @@ -23,11 +25,15 @@ class AgentAffichageAssertionFactory { { /** * @var AgentService $agentService * @var AgentAutoriteService $agentAutoriteService * @var AgentSuperieurService $agentSuperieurService * @var AgentAffectationService $agentAffectationService * @var StructureService $structureService * @var UserService $userService */ $agentService = $container->get(AgentService::class); $agentAutoriteService = $container->get(AgentAutoriteService::class); $agentSuperieurService = $container->get(AgentSuperieurService::class); $agentAffectationService = $container->get(AgentAffectationService::class); $structureService = $container->get(StructureService::class); $userService = $container->get(UserService::class); Loading @@ -35,6 +41,8 @@ class AgentAffichageAssertionFactory { /** @var AgentAssertion $assertion */ $assertion = new AgentAssertion(); $assertion->setAgentService($agentService); $assertion->setAgentAutoriteService($agentAutoriteService); $assertion->setAgentSuperieurService($agentSuperieurService); $assertion->setAgentAffectationService($agentAffectationService); $assertion->setStructureService($structureService); $assertion->setUserService($userService); Loading
module/Application/view/application/index/partial/agents.phtml +3 Changes for module/Application/view/application/index/partial/agents.phtml: 3 added lines, 0 removed lines. Original line number Diff line number Diff line <?php use Application\Entity\Db\Agent; use Application\Provider\Privilege\AgentPrivileges; /** * @var Agent[] $agents Loading Loading @@ -46,10 +47,12 @@ Voue êtes responsable de <?php echo count($agents); ?> agent·es. <?php endforeach; ?> </td> <td class="action"> <?php if ($this->isAllowed($agent, AgentPrivileges::AGENT_AFFICHER)) : ?> <a href="<?php echo $this->url('agent/afficher', ['agent' => $agent->getId()], [], true); ?>"> <span class="icon icon-user"></span> Afficher </a> <?php endif; ?> </td> </tr> <?php endforeach; ?> Loading