Skip to content

Commit c6bea37

Browse files
committed
feature #4957 Added a mention to the @Security annotation (javiereguiluz)
This PR was submitted for the master branch but it was merged into the 2.6 branch instead (closes #4957). Discussion ---------- Added a mention to the @Security annotation | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes | Applies to | 2.6+ | Fixed tickets | - Commits ------- ac88a71 Removed an unneeded reference to Symfony 2.4 version 420b338 Added a mention to the @Security annotation
2 parents 14a080f + ac88a71 commit c6bea37

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cookbook/security/remember_me.rst

+4-6
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ In the following example, the action is only allowed if the user has the
175175
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
176176
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
177177

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

181181
.. code-block:: php
182182
183-
use JMS\SecurityExtraBundle\Annotation\Secure;
183+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
184184
185185
/**
186-
* @Secure(roles="IS_AUTHENTICATED_FULLY")
186+
* @Security("has_role('IS_AUTHENTICATED_FULLY')")
187187
*/
188188
public function editAction($name)
189189
{
@@ -212,5 +212,3 @@ which can secure your controller using annotations:
212212

213213
For more information on securing services or methods in this way,
214214
see :doc:`/cookbook/security/securing_services`.
215-
216-
.. _JMSSecurityExtraBundle: https://github.com/schmittjoh/JMSSecurityExtraBundle

0 commit comments

Comments
 (0)