Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Sep 24, 2015
2 parents 6a01917 + 713541a commit 25fe737
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions cookbook/security/voters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,8 @@ from the authorization checker is called.
// get a Post instance
$post = ...;
<<<<<<< HEAD
$this->denyAccessUnlessGranted('view', $post, 'Unauthorized access!');
=======
// keep in mind that this will call all registered security voters
if (false === $this->get('security.context')->isGranted('view', $post)) {
throw new AccessDeniedException('Unauthorized access!');
}
>>>>>>> 2.3
$this->denyAccessUnlessGranted('view', $post, 'Unauthorized access!');
return new Response('<h1>'.$post->getName().'</h1>');
}
Expand Down

0 comments on commit 25fe737

Please sign in to comment.