[5.x] Fix roles/groups select being empty for non-super users#14889
Open
mynetx wants to merge 1 commit into
Open
[5.x] Fix roles/groups select being empty for non-super users#14889mynetx wants to merge 1 commit into
mynetx wants to merge 1 commit into
Conversation
The UserRoles and UserGroups fieldtypes sit on the user form, where the relevant capability is assigning a role/group to a user. They were gated on "edit roles" / "edit user groups" — the permissions for editing the role/group definitions themselves — so a non-super user who only had "assign roles" got an empty select and couldn't pick a role. Gate them on "assign roles" / "assign user groups" instead, matching how the user form, controller, and bulk actions already authorize this. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or 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
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.
The Roles (and User Groups) select on the user form comes back empty for a non-super user who has the assign roles / assign user groups permission — so they can't pick a role, even though that's exactly what the permission is for.
It's a regression from #14718. That PR scoped the relationship fieldtypes to the current user's permissions, but
UserRolesandUserGroupsgot gated onedit roles/edit user groups— the permissions for editing the role/group definitions — instead ofassign roles/assign user groups. Super users have everything, so it only bit non-super users.These fieldtypes live on the user form, so they now authorize with
assign roles/assign user groups, matching how the user form,UsersController, and the bulk assign actions already gate the same thing.Fixes #14874.