Skip to content

Added a mention to the @Security annotation #4957

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

Closed
Closed
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
10 changes: 4 additions & 6 deletions cookbook/security/remember_me.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ In the following example, the action is only allowed if the user has the
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.

You can also choose to install and use the optional JMSSecurityExtraBundle_,
which can secure your controller using annotations:
If your application is based on the Symfony Standard Edition, you can also secure
your controller using annotations:

.. code-block:: php

use JMS\SecurityExtraBundle\Annotation\Secure;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;

/**
* @Secure(roles="IS_AUTHENTICATED_FULLY")
* @Security("has_role('IS_AUTHENTICATED_FULLY')")
*/
public function editAction($name)
{
Expand Down Expand Up @@ -212,5 +212,3 @@ which can secure your controller using annotations:

For more information on securing services or methods in this way,
see :doc:`/cookbook/security/securing_services`.

.. _JMSSecurityExtraBundle: https://github.com/schmittjoh/JMSSecurityExtraBundle