Skip to content

[2.1] Fixes #37701: Reserve the Admin role name and label the admin flag apart from roles (backport 2.1 #37702) - #38122

Merged
manerow merged 1 commit into
2.1from
fix/admin-role-name-collision-2.1
Nov 18, 2026
Merged

manerow merged 1 commit into
2.1from
fix/admin-role-name-collision-2.1

Conversation

@manerow

@manerow manerow commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #37702 to 2.1. Fixes #37701.

Admin access is the isAdmin flag on a user or bot, not a role, but the role editors list the flag as an option called "Admin". A custom role named Admin therefore showed up as a second, identical "Admin" option. The server now rejects a new role named Admin (any case) with a 400; existing roles with that name keep working. In the UI, the flag reads "Admin (superuser)" wherever it is listed among roles.

Cherry-picked from 27ea2c45ed5; applied cleanly, and git patch-id --stable is identical to the original commit.

Type of change:

  • Bug fix

Tests:

Unit tests

Backend integration tests

  • RoleResourceIT#test_roleNamedAdminIsRejected on 2.1: passed (MySQL + Elasticsearch, isolated and parallel lanes).

UI screen recording:

Not applicable: a bug fix that changes a label.

Checklist:

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Reserves the name Admin for new roles and labels the admin flag as “Admin (superuser)” across role displays and editors.

  • The role API rejects new roles named Admin, regardless of case.
  • User and bot role lists distinguish the admin flag from actual roles.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "Fixes 37701: Reserve the Admin role name..." · Reviewed by Greptile

@manerow
manerow requested review from a team as code owners November 18, 2026 13:05
@manerow manerow added UI UI specific issues backend skip-pr-checks Bypass PR metadata validation check labels Nov 18, 2026
@manerow
manerow requested review from sonika-shah and removed request for a team November 18, 2026 13:05
@manerow manerow added UI UI specific issues backend skip-pr-checks Bypass PR metadata validation check labels Nov 18, 2026
@manerow
manerow requested review from ShaileshParmar11 and removed request for a team November 18, 2026 13:05
@gitar-bot

gitar-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Rejecting case-insensitive Admin role creation changes the role API’s accepted inputs and could prevent clients from creating roles with that name.

Reserves Admin as a role name (any case) so a custom role can no longer duplicate the isAdmin flag, which is now labeled "Admin (superuser)" in role lists. Existing roles with that name keep working. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@manerow
manerow merged commit 41a8722 into 2.1 Nov 18, 2026
49 checks passed
@manerow
manerow deleted the fix/admin-role-name-collision-2.1 branch November 18, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant