Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6a01917 + 713541a commit 25fe737Copy full SHA for 25fe737
cookbook/security/voters.rst
@@ -224,14 +224,8 @@ from the authorization checker is called.
224
// get a Post instance
225
$post = ...;
226
227
-<<<<<<< HEAD
228
- $this->denyAccessUnlessGranted('view', $post, 'Unauthorized access!');
229
-=======
230
// keep in mind that this will call all registered security voters
231
- if (false === $this->get('security.context')->isGranted('view', $post)) {
232
- throw new AccessDeniedException('Unauthorized access!');
233
- }
234
->>>>>>> 2.3
+ $this->denyAccessUnlessGranted('view', $post, 'Unauthorized access!');
235
236
return new Response('<h1>'.$post->getName().'</h1>');
237
}
0 commit comments