diff --git a/module/Application/src/Application/View/Helper/partial/application-bloc.phtml b/module/Application/src/Application/View/Helper/partial/application-bloc.phtml index 2b2122ee7f3fbc0bd2913ff66be92080d6ba02f2..89f29cac865ad8d84d986670a3d7eb6ec610e273 100644 --- a/module/Application/src/Application/View/Helper/partial/application-bloc.phtml +++ b/module/Application/src/Application/View/Helper/partial/application-bloc.phtml @@ -10,6 +10,7 @@ use Application\Provider\Privilege\AgentPrivileges; use Application\Provider\Privilege\FicheMetierPrivileges; use Application\View\Helper\CompetenceBlocViewHelper; use Formation\Entity\Db\Formation; +use Formation\Provider\Privilege\FormationPrivileges; /** * @see \Application\View\Helper\ApplicationBlocViewHelper @@ -40,8 +41,13 @@ if ($objet instanceof FicheMetier) { $canAcquisAfficher = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::FICHEMETIER_AFFICHER)); $canAcquisModifier = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::FICHEMETIER_MODIFIER)); } else { - $canAcquisAfficher = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_AFFICHER); - $canAcquisModifier = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_MODIFIER); + if ($objet instanceof Formation) { + $canAcquisAfficher = $this->isAllowed(FormationPrivileges::getResourceId(FormationPrivileges::FORMATION_AFFICHER)); + $canAcquisModifier = $this->isAllowed(FormationPrivileges::getResourceId(FormationPrivileges::FORMATION_MODIFIER)); + } else { + $canAcquisAfficher = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_AFFICHER); + $canAcquisModifier = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_MODIFIER); + } } $canAfficher = (CompetenceBlocViewHelper::isActionActivee($options, 'afficher') AND $canAcquisAfficher); diff --git a/module/Application/src/Application/View/Helper/partial/competence-bloc.phtml b/module/Application/src/Application/View/Helper/partial/competence-bloc.phtml index e30d736dcccafd2d757fad92fe8a900e1b07a5ac..15928fe87a7c40685596f20c57b889e769058cbb 100644 --- a/module/Application/src/Application/View/Helper/partial/competence-bloc.phtml +++ b/module/Application/src/Application/View/Helper/partial/competence-bloc.phtml @@ -12,6 +12,7 @@ use Application\Provider\Privilege\CompetencePrivileges; use Application\Provider\Privilege\FicheMetierPrivileges; use Application\View\Helper\CompetenceBlocViewHelper; use Formation\Entity\Db\Formation; +use Formation\Provider\Privilege\FormationPrivileges; /** * @see \Application\View\Helper\CompetenceBlocViewHelper @@ -42,8 +43,13 @@ if ($objet instanceof FicheMetier) { $canAcquisAfficher = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::FICHEMETIER_AFFICHER)); $canAcquisModifier = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::FICHEMETIER_MODIFIER)); } else { - $canAcquisAfficher = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_AFFICHER); - $canAcquisModifier = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_MODIFIER); + if ($objet instanceof Formation) { + $canAcquisAfficher = $this->isAllowed(FormationPrivileges::getResourceId(FormationPrivileges::FORMATION_AFFICHER)); + $canAcquisModifier = $this->isAllowed(FormationPrivileges::getResourceId(FormationPrivileges::FORMATION_MODIFIER)); + } else { + $canAcquisAfficher = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_AFFICHER); + $canAcquisModifier = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_MODIFIER); + } } $canAfficher = (CompetenceBlocViewHelper::isActionActivee($options, 'afficher') AND $canAcquisAfficher);