Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit99163ed

Browse files
committed
Mention @Security() annotation instead of@secure()
1 parent6ba90ec commit99163ed

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

‎cookbook/security/remember_me.rst‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,21 +175,25 @@ 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 usetheoptionalJMSSecurityExtraBundle_,
179-
which can secureyour controller using annotations:
178+
If your application is based ontheSymfony Standard Edition, you can also secure
179+
your controller using annotations:
180180

181181
..code-block::php
182182
183-
useJMS\SecurityExtraBundle\Annotation\Secure;
183+
useSensio\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
{
190190
// ...
191191
}
192192
193+
..versionadded::2.4
194+
The ``@Security`` annotation was introduced in SensioFrameworkExtraBundle 3.0,
195+
which can only be used with Symfony 2.4 or later.
196+
193197
..tip::
194198

195199
If you also had an access control in your security configuration that
@@ -212,5 +216,3 @@ which can secure your controller using annotations:
212216

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp