Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cookbook][Security] update versionadded directive to match the content #5731

Merged
merged 1 commit into from
Nov 5, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions cookbook/security/voters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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!

Expand Down