-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Security] Add tip for using new isGrantedForUser() function #18033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one 👍🏻
04a091b
to
7815041
Compare
security.rst
Outdated
.. versionadded:: 6.4 | ||
|
||
The :method:`Symfony\\Bundle\\SecurityBundle\\Security::userIsGranted` | ||
method was introduced in Symfony 6.4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to update the two v6.4 references to the relevant release once symfony/symfony#48142 is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps add as well a code block example :)
…(natewiebe13) This PR was merged into the 7.3 branch. Discussion ---------- [Security][SecurityBundle] User authorization checker | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #43372 | License | MIT | Doc PR | symfony/symfony-docs#18033 `isGranted()` assumes that it's checking against the currently logged in user. This provides the same functionality to check against a user during times when there isn't a session (cronjobs/commands, message queue, etc.) or for a different user than the one logged in. Having this functionality allows for removing the dependency on sessions entirely for services reducing the number of issues that come up during a project because some underlying function was session dependent. Commits ------- 096bfaa [Security][SecurityBundle] User authorization checker
7815041
to
0b07226
Compare
0b07226
to
c196b44
Compare
Thanks Nate! Sorry it took us so long to merge this feature and its docs 🙏 |
Adds tip for using new
isGrantedForUser()
function from symfony/symfony#48142