From 4db7055dae6e4406405bfa32ad7458f712bfe35c Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 27 Sep 2015 12:36:27 +0200 Subject: [PATCH] update versionadded directive to match the content --- cookbook/security/voters.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cookbook/security/voters.rst b/cookbook/security/voters.rst index ec5404ef2a9..d995e2af41b 100644 --- a/cookbook/security/voters.rst +++ b/cookbook/security/voters.rst @@ -207,9 +207,10 @@ How to Use the Voter in a Controller ------------------------------------ The registered voter will then always be asked as soon as the method ``isGranted()`` -from the authorization checker is called. - -.. code-block:: php +from the authorization checker is called. When extending the base ``Controller`` +class, you can simply call the +:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::denyAccessUnlessGranted()` +method:: // src/AppBundle/Controller/PostController.php namespace AppBundle\Controller; @@ -232,9 +233,9 @@ from the authorization checker is called. } .. versionadded:: 2.6 - The ``security.authorization_checker`` service was introduced in Symfony 2.6. - Prior to Symfony 2.6, you had to use the ``isGranted()`` method of the - ``security.context`` service. + The ``denyAccessUnlessGranted()`` method was introduced in Symfony 2.6. + Prior to Symfony 2.6, you had to call the ``isGranted()`` method of the + ``security.context`` service and throw the exception yourself. It's that easy!