Skip to content

Commit

Permalink
Merge pull request #1343 from dannyvw/fix/access
Browse files Browse the repository at this point in the history
[UserManagementBundle] Use built-in authorization check
  • Loading branch information
Kristof Jochmans authored Nov 2, 2016
2 parents e265576 + 853e035 commit 0553b62
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function addAction(Request $request)

if ($formType instanceof RoleDependentUserFormInterface) {
// to edit groups and enabled the current user should have ROLE_SUPER_ADMIN
$options['can_edit_all_fields'] = $this->container->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN');
$options['can_edit_all_fields'] = $this->isGranted('ROLE_SUPER_ADMIN');
}

$form = $this->createForm(
Expand Down Expand Up @@ -170,7 +170,7 @@ public function editAction(Request $request, $id)

if ($formType instanceof RoleDependentUserFormInterface) {
// to edit groups and enabled the current user should have ROLE_SUPER_ADMIN
$options['can_edit_all_fields'] = $this->container->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN');
$options['can_edit_all_fields'] = $this->isGranted('ROLE_SUPER_ADMIN');
}

$event = new AdaptSimpleFormEvent($request, $formFqn, $user, $options);
Expand Down

0 comments on commit 0553b62

Please sign in to comment.