Commit f488ba07 authored by Florian Joriot's avatar Florian Joriot
Browse files

verif de role sur candidature

parent f47a46c9
Loading
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Mission\Controller;
use Application\Controller\AbstractController;
use Application\Provider\Privilege\Privileges;
use Application\Service\Traits\ContextServiceAwareTrait;
use BjyAuthorize\Exception\UnAuthorizedException;
use Intervenant\Entity\Db\Intervenant;
use Laminas\View\Model\ViewModel;
use Mission\Entity\Db\Candidature;
@@ -318,6 +319,11 @@ class OffreEmploiController extends AbstractController
         * @var Intervenant   $intervenant
         * @var WorkflowEtape $etapeDonneesPersos
         */
        $canAcces = $this->isAllowed(Privileges::getResourceId(Privileges::MISSION_CANDIDATURE_VISUALISATION));
        if (!$canAcces) {
            throw new UnAuthorizedException();
        }

        $intervenant                   = $this->getEvent()->getParam('intervenant');
        $renseignerDonneesPersonnelles = false;
        $canValiderCandidature         = $this->isAllowed($intervenant, Privileges::MISSION_CANDIDATURE_VALIDER);
@@ -340,6 +346,11 @@ class OffreEmploiController extends AbstractController

    public function getCandidaturesAction()
    {
        $canAcces = $this->isAllowed(Privileges::getResourceId(Privileges::MISSION_CANDIDATURE_VISUALISATION));
        if (!$canAcces) {
            throw new UnAuthorizedException();
        }

        $intervenant = $this->getEvent()->getParam('intervenant');
        if (!$intervenant) {
            throw new \LogicException('Intervenant introuvable');