Skip to content

Commit eabb982

Browse files
committed
minor #5731 [Cookbook][Security] update versionadded directive to match the content (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [Cookbook][Security] update versionadded directive to match the content | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.7+ | Fixed tickets | Commits ------- 4db7055 update versionadded directive to match the content
2 parents 63e9824 + 4db7055 commit eabb982

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cookbook/security/voters.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,10 @@ How to Use the Voter in a Controller
207207
------------------------------------
208208

209209
The 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

239240
It's that easy!
240241

0 commit comments

Comments
 (0)