Skip to content

[5.x] Fix read-only state of roles and groups fields #11867

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

Merged
merged 2 commits into from
Jun 19, 2025

Conversation

aerni
Copy link
Contributor

@aerni aerni commented Jun 11, 2025

I noticed that the user_roles and user_groups fields in the user blueprint aren't displayed as read_only even if a user doesn't have the assign roles and assign user groups permissions. This PR fixes that. It's only a UI fix, as the UsersController already guards the fields from being updated without the appropriate permissions.

Before:
CleanShot 2025-06-11 at 19 06 09@2x

After:
CleanShot 2025-06-11 at 19 06 39@2x

I actually went a step further and decided to hide the fields instead of making them read-only. I think this is more appropriate. Users without permission to change their role and group shouldn't be able to see those fields at all. It's just confusing.

@jasonvarga jasonvarga merged commit 2344760 into statamic:5.x Jun 19, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants