public function updateProgressionAction(Step $step, User $user, Request $request)
    {
        $node = $step->getPath()->getResourceNode();

        if (!$this->authorization->isGranted('OPEN', new ResourceCollection([$node]))) {
            throw new AccessDeniedException('Operation "OPEN" cannot be done on object'.get_class($node));
        }
        $status = $this->decodeRequest($request)['status'];
        $this->userProgressionManager->update($step, $user, $status, true);
        $this->userProgressionManager->generateResourceEvaluation($step, $user, $status);
        $resourceUserEvaluation = $this->userProgressionManager->getResourceUserEvaluation($step->getPath(), $user);

        return new JsonResponse([
            'userEvaluation' => $this->serializer->serialize($resourceUserEvaluation),
            'userProgression' => [
                'stepId' => $step->getUuid(),
                'status' => $status,
            ],
        ]);
    }
public function updateProgressionAction(Step $step, User $user, Request $request)
    {
        $node = $step->getPath()->getResourceNode();

        if (!$this->authorization->isGranted('OPEN', new ResourceCollection([$node]))) {
            throw new AccessDeniedException('Operation "OPEN" cannot be done on object'.get_class($node));
        }
        $status = $this->decodeRequest($request)['status'];
        $this->userProgressionManager->update($step, $user, $status, true);
        $this->userProgressionManager->generateResourceEvaluation($step, $user, $status);
        $resourceUserEvaluation = $this->userProgressionManager->getResourceUserEvaluation($step->getPath(), $user);

        return new JsonResponse([
            'userEvaluation' => $this->serializer->serialize($resourceUserEvaluation),
            'userProgression' => [
                'stepId' => $step->getUuid(),
                'status' => $status,
            ],
        ]);
    }
public function updateProgressionAction ( Step $ step , User $ user , Request $ request ) { $ node = $ step -> getPath ( ) -> getResourceNode ( ) ; if ( ! $ this -> authorization -> isGranted ( 'OPEN' , new ResourceCollection ( [ $ node ] ) ) ) { throw new AccessDeniedException ( 'Operation "OPEN" cannot be done on object' . get_class ( $ node ) ) ; } $ status = $ this -> decodeRequest ( $ request ) [ 'status' ] ; $ this -> userProgressionManager -> update ( $ step , $ user , $ status , true ) ; $ this -> userProgressionManager -> generateResourceEvaluation ( $ step , $ user , $ status ) ; $ resourceUserEvaluation = $ this -> userProgressionManager -> getResourceUserEvaluation ( $ step -> getPath ( ) , $ user ) ; return new JsonResponse ( [ 'userEvaluation' => $ this -> serializer -> serialize ( $ resourceUserEvaluation ) , 'userProgression' => [ 'stepId' => $ step -> getUuid ( ) , 'status' => $ status , ] , ] ) ; }
Update step progression for an user.

@EXT\Route("/step/{id}/progression/update", name="innova_path_progression_update")
@EXT\Method("PUT")
@EXT\ParamConverter(
"step",
class="InnovaPathBundle:Step",
options={"mapping": {"id": "uuid"}}
)
@EXT\ParamConverter("user", converter="current_user", options={"allowAnonymous"=false})

@param Step    $step
@param User    $user
@param Request $request

@return JsonResponse
Update step progression for an user .