Skip to content

Add a Roles page for admins - #13166

Merged
iHiD merged 4 commits into
admin-add-trackfrom
admin-roles
Nov 26, 2026
Merged

iHiD merged 4 commits into
admin-add-trackfrom
admin-roles

Conversation

@iHiD

@iHiD iHiD commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

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/roles without 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::RolesController calls User::AddRoles and User::RemoveRoles, so Discord roles, Insiders status and analytics update the same way they do for other role changes.
  • User::RetrieveRoleHolders finds users who have any role, or users who have one chosen role, and returns 50 per page.
  • User::Roles::ASSIGNABLE lists the assignable roles: admin, maintainer_admin, maintainer, staff, founder, moderator and supermentor. User::Roles.label gives each one a readable name for the page.
  • An admin can't remove their own admin role, so nobody can lock themselves out.
  • "Roles" appears in the Admin group of the sidebar.

Risks

  • The website syncs the maintainer role from GitHub team membership and the supermentor role from mentoring stats. A change to either role made on this page will be undone at the next sync. The page shows a warning about this.
  • The page shows names and handles, so it is admin only.

🤖 Generated with Claude Code

iHiD and others added 4 commits November 26, 2026 17:01
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>
@iHiD
iHiD merged commit ea6ada6 into main Nov 26, 2026
88 of 99 checks passed
@iHiD
iHiD deleted the admin-roles branch November 26, 2026 08:30
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.

1 participant