Repository navigation
Add a Roles page for admins - #13166
Merged
Merged
Conversation
Admins can now see everyone with a role at /admin/roles, filter the list by role, and give or take away each role. The page uses User::AddRoles and User::RemoveRoles, so Discord, Insiders and analytics are updated as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Role tags, the role select and the messages now use the same names as
the filter ("Maintainer admin"). The add-a-role column has a fixed width,
so the select is the same size on every row and the button stays inside
the table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A form above the roles table takes a handle and a role, so an admin can give a role to someone who isn't in the table yet. If no user has the handle, the page says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
This is PR 4 of 4 in a stack. Merge them in order: the access levels PR, then the admin section layout, then the "Add a track" page, then this PR (Roles).
What this changes for people
Admins can manage roles at
/admin/roleswithout a Rails console. The page lists everyone with at least one role, with their handle, name and roles. It can be filtered by role. An admin can add a role from a drop-down on each row, and remove a role by clicking it (after a confirmation). To give a role to someone who isn't in the table yet, an admin enters their handle in the form above the table.What changed
Admin::RolesControllercallsUser::AddRolesandUser::RemoveRoles, so Discord roles, Insiders status and analytics update the same way they do for other role changes.User::RetrieveRoleHoldersfinds users who have any role, or users who have one chosen role, and returns 50 per page.User::Roles::ASSIGNABLElists the assignable roles: admin, maintainer_admin, maintainer, staff, founder, moderator and supermentor.User::Roles.labelgives each one a readable name for the page.Risks
🤖 Generated with Claude Code