Commit 977b2088 authored by Florian Joriot's avatar Florian Joriot
Browse files

Correction contrat assertion --> recup de l'intervenant par contrat quand intervenant absent

parent 6140640d
Loading
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -312,14 +312,21 @@ class ContratAssertion extends AbstractAssertion
            case ContratController::class . '.supprimerProcessSignature':
            case ContratController::class . '.rafraichirProcessSignature':
                $intervenant = $this->getParam(Intervenant::class);
                if (!$intervenant) {
                    $contrat = $this->getParam(Contrat::class);
                    if ($contrat) {
                        $intervenant = $contrat->getIntervenant();
                    }
                }
                if ($intervenant) {
                    $feuilleDeRoute = $this->getServiceWorkflow()->getFeuilleDeRoute($intervenant);
                    $wfEtape        = $feuilleDeRoute->get(WorkflowEtape::CONTRAT);
                    if ($wfEtape && $wfEtape->isAllowed()) return true;
                }else{
                    throw new UnAuthorizedException('Action de contrôleur ' . $controller . ':' . $action . ' non autorisée');
                }
            default: throw new UnAuthorizedException('Action de contrôleur ' . $controller . ':' . $action . ' non traitée');

                throw new UnAuthorizedException('Action de contrôleur ' . $controller . ':' . $action . ' non autorisée');
            default:
                throw new UnAuthorizedException('Action de contrôleur ' . $controller . ':' . $action . ' non traitée');
        }
    }
}
 No newline at end of file