Skip to content

Commit 4db7055

Browse files
committed
update versionadded directive to match the content
1 parent 713541a commit 4db7055

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)