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

Correction assertion trop exigente.

parent f230bd56
Loading
Loading
Loading
Loading
Loading
+4 −8
Changes for module/Application/src/Application/Assertion/These/TheseControllerAssertion.php: 4 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -57,19 +57,15 @@ class TheseControllerAssertion implements ControllerAssertionInterface
     */
    public function assert($controller, $action = null, $privilege = null)
    {
        if (! $this->these) {
            return false;
        switch (true) {
            case $this->selectedRoleIsDoctorant():
                return $this->assertAsDoctorant($controller, $action);
        }

        if (! $this->isStructureDuRoleRespectee()) {
            return false;
        }

        switch (true) {
            case $this->selectedRoleIsDoctorant():
                return $this->assertAsDoctorant($controller, $action);
        }

//        switch (true) {
//            case $this->actionIs($controller, $action, self::THESE_CONTROLLER, 'valider-rdv-bu'):
//                // aucune validation ne doit exister
@@ -143,7 +139,7 @@ class TheseControllerAssertion implements ControllerAssertionInterface
     */
    protected function isUtilisateurEstAuteurDeLaThese()
    {
        return $this->these->getDoctorant()->getId() === $this->getIdentityDoctorant()->getId();
        return $this->these && $this->these->getDoctorant()->getId() === $this->getIdentityDoctorant()->getId();
    }

    private function actionIs($controller, $action, $expectedController, $expectedAction) {