File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -207,9 +207,10 @@ How to Use the Voter in a Controller
207207------------------------------------
208208
209209The registered voter will then always be asked as soon as the method ``isGranted() ``
210- from the authorization checker is called.
211-
212- .. code-block :: php
210+ from the authorization checker is called. When extending the base ``Controller ``
211+ class, you can simply call the
212+ :method: `Symfony\\ Bundle\\ FrameworkBundle\\ Controller\\ Controller::denyAccessUnlessGranted() `
213+ method::
213214
214215 // src/AppBundle/Controller/PostController.php
215216 namespace AppBundle\Controller;
@@ -232,9 +233,9 @@ from the authorization checker is called.
232233 }
233234
234235.. versionadded :: 2.6
235- The ``security.authorization_checker `` service was introduced in Symfony 2.6.
236- Prior to Symfony 2.6, you had to use the ``isGranted() `` method of the
237- ``security.context `` service.
236+ The ``denyAccessUnlessGranted() `` method was introduced in Symfony 2.6.
237+ Prior to Symfony 2.6, you had to call the ``isGranted() `` method of the
238+ ``security.context `` service and throw the exception yourself .
238239
239240It's that easy!
240241
You can’t perform that action at this time.
0 commit comments