diff --git a/cookbook/security/voters.rst b/cookbook/security/voters.rst index 9c980c38f6c..ec5404ef2a9 100644 --- a/cookbook/security/voters.rst +++ b/cookbook/security/voters.rst @@ -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('

'.$post->getName().'

'); }