getPendingRoles(), true)) { throw $this->createNotFoundException('Für diese Rolle liegt keine Freischaltung vor'); } if (true === $request->isMethod(Request::METHOD_POST)) { // checked again by the handler, which is what catches a sync revoking the claim // between opening the dialog and confirming it if (false === $this->userDataHandler->approveRole($user, $role)) { throw $this->createNotFoundException('Für diese Rolle liegt keine Freischaltung vor'); } $this->addFlash('success', sprintf('Die Rolle %s wurde freigeschaltet', User::ROLES[$role])); return new HxRedirectResponse($this->generateUrl('app_admin_system_user_edit', ['id' => $user->getId()])); } return $this->render('admin/system/user/modal_approve_role.html.twig', [ 'user' => $user, 'roleLabel' => User::ROLES[$role], ]); } }