Skip to content

Commit a309c60

Browse files
committed
Use the is_granted expression to keep consistency with php example above
As `has_role` only check for roles without calling the voter, it does not do the same job that `$this->get('security.context')->isGranted('ROLE_ADMIN')` So it is quiete confusing.
1 parent b9bbe5d commit a309c60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

book/security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ Thanks to the SensioFrameworkExtraBundle, you can also secure your controller us
10911091
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
10921092

10931093
/**
1094-
* @Security("has_role('ROLE_ADMIN')")
1094+
* @Security("is_granted('ROLE_ADMIN')")
10951095
*/
10961096
public function helloAction($name)
10971097
{

0 commit comments

Comments
 (0)