From 04778fb84e8e5b98dff2e0a132cf5866df787a4d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 3 Feb 2015 15:09:04 +0100 Subject: [PATCH 1/2] Added a mention to the @Security annotation --- cookbook/security/remember_me.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cookbook/security/remember_me.rst b/cookbook/security/remember_me.rst index f58aab6ac4a..b6eefdebc9b 100644 --- a/cookbook/security/remember_me.rst +++ b/cookbook/security/remember_me.rst @@ -175,21 +175,25 @@ 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) { // ... } +.. versionadded:: 2.4 + The ``@Security`` annotation was introduced in SensioFrameworkExtraBundle 3.0, + which can only be used with Symfony 2.4 or later. + .. tip:: If you also had an access control in your security configuration that @@ -212,5 +216,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 From f624787944e514b5ac5a4689d73bf4343488467c Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sun, 8 Feb 2015 18:41:18 +0100 Subject: [PATCH 2/2] Removed an unneeded reference to Symfony 2.4 version --- cookbook/security/remember_me.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cookbook/security/remember_me.rst b/cookbook/security/remember_me.rst index b6eefdebc9b..4a302a16c49 100644 --- a/cookbook/security/remember_me.rst +++ b/cookbook/security/remember_me.rst @@ -190,10 +190,6 @@ your controller using annotations: // ... } -.. versionadded:: 2.4 - The ``@Security`` annotation was introduced in SensioFrameworkExtraBundle 3.0, - which can only be used with Symfony 2.4 or later. - .. tip:: If you also had an access control in your security configuration that