-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
use is_granted() instead of deprecated has_role() #9919
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
@OskarStark thanks for updating this! I found other occurrences. Could you please change them in this PR too?
Thanks! |
sure thing 👍 |
security/expressions.rst
Outdated
@@ -61,7 +61,7 @@ Additionally, you have access to a number of functions inside the expression: | |||
Similar, but not equal to ``IS_AUTHENTICATED_REMEMBERED``, see below. | |||
``is_fully_authenticated`` | |||
Similar, but not equal to ``IS_AUTHENTICATED_FULLY``, see below. | |||
``has_role`` | |||
``is_granted`` |
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.
@javiereguiluz I found another one here, not sure if the description is still ok for is_granted
instead of has_role
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.
I agree. Here is a quick proposal:
Checks if the user has the given permission. Optionally accepts a second argument
with the object where permission is checked on. It's equivalent to using
the :doc:`isGranted() method </security/securing_services>` from the authorization
checker service.
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.
done
Thank you Oskar. |
…tark) This PR was merged into the master branch. Discussion ---------- use is_granted() instead of deprecated has_role() using `has_role()` was deprecated in symfony/symfony#27305 since `4.2` by @nicolas-grekas Commits ------- 5e6031b use is_granted() instead of deprecated has_role()
using
has_role()
was deprecated in symfony/symfony#27305 since4.2
by @nicolas-grekas