Skip to content

Commit

Permalink
Merge branch '2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Sep 24, 2015
2 parents a46560c + 25fe737 commit 194f5cc
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions cookbook/security/voters.rst
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 194f5cc

Please sign in to comment.