-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
[5.x] Changes to User
role methods
#9921
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ey are in the "main" `getRoles` method
duncanmcclean
changed the title
[5.x] Tweaks to role/group methods
[5.x] Include roles via groups in Apr 17, 2024
hasRole
method
duncanmcclean
changed the title
[5.x] Include roles via groups in
[5.x] Check roles via groups in Apr 17, 2024
hasRole
methodhasRole
method
duncanmcclean
changed the title
[5.x] Check roles via groups in
[5.x] Changes to role methods on Apr 18, 2024
hasRole
methodUser
classes
duncanmcclean
changed the title
[5.x] Changes to role methods on
[5.x] Changes to Apr 18, 2024
User
classesUser
role methods
jasonvarga
approved these changes
Apr 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request makes some changes to the role methods on Statamic's
User
classes:->roles()
method now returns roles assigned via groups, in addition to roles directly assigned to the user.->roles()
method is no longer a setter, only a getter.->explicitRoles()
method, which returns the roles explicitly set on the user.->explicitRoles(['role_1', 'role_2'])
.Breaking Changes
$user->roles()
method,$user->hasRole()
method and{{ user:is role="role_1" }}
tag now check if a user has the provided role via groups.->roles(['role_1'])
method, you should now use the->explicitRoles()
method.