Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
minor #624 Add example of @IsGranted() with multiple roles. (mattja…
Browse files Browse the repository at this point in the history
…nssen)

This PR was merged into the 5.4.x-dev branch.

Discussion
----------

Add example of `@IsGranted()` with multiple roles.

There are use cases of `@IsGranted()` where we want to check that a user has any one of multiple roles that don't intersect in the role hierarchy. I've seen this is two separate occasions already, especially with people migrating away from the JMSSecurityExtraBundle.

Does including one example make sense? Should there be a separate sentence or paragraph pointing this out?

Commits
-------

97cc360 Add example of `@IsGranted()` with multiple roles.
  • Loading branch information
fabpot committed Jul 3, 2019
2 parents ea677b6 + 97cc360 commit 2118f27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Resources/doc/annotations/security.rst
Expand Up @@ -34,7 +34,7 @@ on variables passed to the controller::
/**
* @Route("/posts/{id}")
*
* @IsGranted("ROLE_ADMIN")
* @IsGranted({"ROLE_ADMIN", "ROLE_SYSTEM"})
* @IsGranted("POST_SHOW", subject="post")
*/
public function show(Post $post)
Expand Down

0 comments on commit 2118f27

Please sign in to comment.