Commit 7429505c authored by Florian Joriot's avatar Florian Joriot
Browse files

verif de role sur candidature

parent 941c2f2a
Loading
Loading
Loading
Loading
Loading
+12 −0
Changes for module/Mission/src/Controller/OffreEmploiController.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ use Application\Provider\Privilege\Privileges;
use Application\Service\Traits\ContextServiceAwareTrait;
use Application\Service\Traits\ValidationServiceAwareTrait;
use Application\Service\Traits\WorkflowServiceAwareTrait;
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,12 @@ 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');