Commit ba2ff42f authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'hotfix_menu_depot_doctorant'

parents 7e30e93a 25ab0e1e
Loading
Loading
Loading
Loading
+10 −4
Changes for module/Application/src/Application/Assertion/These/TheseControllerAssertion.php: 10 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -62,19 +62,25 @@ class TheseControllerAssertion extends ControllerAssertion
        return true;
    }

    protected function assertAsDoctorant()
    protected function assertAsDoctorant(): bool
    {
        if ($this->getIdentityDoctorant() === null) {
        $identityDoctorant = $this->getIdentityDoctorant();

        if ($identityDoctorant === null) {
            throw new RuntimeException("Anomalie: le role doctorant est sélectionné mais aucune donnée d'identité doctorant n'est disponible");
        }

        switch (true) {
            case $this->actionIs(self::DOCTORANT_CONTROLLER, 'modifier-persopass'):
                return $this->doctorant && $this->doctorant->getId() === $this->getIdentityDoctorant()->getId();
                return $this->doctorant && $this->doctorant->getId() === $identityDoctorant->getId();
                break;
        }

        return $this->these && $this->these->getDoctorant()->getId() === $this->getIdentityDoctorant()->getId();
        if ($this->these === null) {
            return true;
        }

        return $this->these->getDoctorant()->getId() === $identityDoctorant->getId();
    }

    /**