Commit 2c0b6141 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Renforcement de la sécurité au cas ou un intervenant aurait accès au menu...

Renforcement de la sécurité au cas ou un intervenant aurait accès au menu Services (ce qui n'est pas prévu actuellement)
parent 6d8d53ac
Loading
Loading
Loading
Loading
+2
Changes for module/Application/src/Application/Controller/ServiceController.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ class ServiceController extends AbstractController
            $recherche = new Recherche;
            $recherche->setTypeVolumeHoraire($this->getServiceTypeVolumehoraire()->getPrevu());
            $recherche->setEtatVolumeHoraire($this->getServiceEtatVolumeHoraire()->getSaisi());
            $recherche->setIntervenant($intervenant);
        }

        /* Préparation et affichage */
@@ -176,6 +177,7 @@ class ServiceController extends AbstractController
            $recherche = new Recherche();
            $recherche->setTypeVolumeHoraire($this->getServiceTypeVolumehoraire()->getPrevu());
            $recherche->setEtatVolumeHoraire($this->getServiceEtatVolumeHoraire()->getSaisi());
            $recherche->setIntervenant($intervenant);
        }

        $etatSortie = $this->getServiceEtatSortie()->getByParametre('es_services_pdf');
+6
Changes for module/Application/src/Application/Service/LocalContextService.php: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Application\Service;

use Application\Service\Traits\ContextServiceAwareTrait;
use Application\Service\Traits\ElementPedagogiqueServiceAwareTrait;
use Application\Service\Traits\EtapeServiceAwareTrait;
use Application\Service\Traits\IntervenantServiceAwareTrait;
@@ -27,6 +28,7 @@ class LocalContextService extends AbstractService
    use ElementPedagogiqueServiceAwareTrait;
    use NiveauEtapeServiceAwareTrait;
    use SessionContainerTrait;
    use ContextServiceAwareTrait;

    /**
     * Intervenant
@@ -63,11 +65,15 @@ class LocalContextService extends AbstractService
    public function getIntervenant()
    {
        if (empty($this->intervenant)) {
            if ($intervenant = $this->getServiceContext()->getSelectedIdentityRole()->getIntervenant()) {
                $this->intervenant = $intervenant;
            } else {
                $this->intervenant = $this->getSessionContainer()->intervenant;
                if ($this->intervenant && !$this->intervenant instanceof Intervenant) {
                    $this->intervenant = $this->getServiceIntervenant()->get($this->intervenant);
                }
            }
        }

        return $this->intervenant;
    }