Skip to content

Fixes #39766: Show the Admin role in user tables, as the Access tab does - #39767

Merged
Rohit0301 merged 3 commits into
open-metadata:mainfrom
Rohit0301:Rohit0301/ai-members-table-roles-fix
Dec 4, 2026
Merged

Rohit0301 merged 3 commits into
open-metadata:mainfrom
Rohit0301:Rohit0301/ai-members-table-roles-fix

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #39766

Admin is stored on the user as the isAdmin flag, not as a role entity. The Access tab (RolesRow) added it as a synthetic "Admin (superuser)" chip. Every user table read only user.roles, so an admin with no other role showed "No role", and an admin with other roles was missing Admin.

  • Added getUserRoleRefs(user, adminLabel) in utils/UsersPureUtils.ts. It returns the user's roles, with Admin first when isAdmin. Putting Admin first keeps it out of the "+N more" overflow.
  • RolesRow (Access tab) and all user tables now build their role list from this helper:
    • AI mode: Members › Users, Members › Online users, Team detail › Users, Persona › Users
    • Classic: Team detail › Users, Online users
  • Admin has no role page, so EntityLinksCell and the classic roles column render it as text, not a link.
  • Two more places read only user.roles and are fixed the same way:
    • User hover card (UserRoles): an admin with no other role showed no Roles section at all.
    • CSV bulk-edit user picker: admins were described by their first role or their team. formatUsersResponse now keeps isAdmin from the search document, so the picker can use it.

Type of change:

  • Bug fix

Tests:

Which test layer and why

Jest. The helper is pure logic, and the table change is a leaf-cell render.

Use cases covered

  • An admin with no roles shows "Admin (superuser)" in the user tables.
  • An admin with roles shows Admin first, then the other roles.
  • A non-admin shows only their role entities. Each is still a link to its role page.

Unit tests

  • utils/Users.util.test.tsx: getUserRoleRefs with roles only, no roles, admin only, and admin plus roles.
  • MembersUsersPanel.test.tsx: an admin with no roles shows Admin, not "No role".
  • UserRoles.test.tsx: an admin with no role entities still shows the Roles section with Admin.
  • Ran the members, personas, profile components, Settings/Users, Settings/Team, OnlineUsersPage and UserListPage suites: all pass.

Backend integration tests

  • Not applicable (no backend API changes).

Playwright (UI) tests

  • Not applicable. This is a single-cell render change, covered by Jest.

Manual testing performed

  1. Ran the UI on Vite against a local server (localhost:8585).
  2. Created RoleDemoTeam, RoleDemoPersona, and three users: admin only, admin plus DataSteward, and DataSteward plus DataConsumer.
  3. Checked each table below against the user's Access tab, in AI and classic modes.

Screenshots (after the fix)

Users in the screenshots: Demo Admin Only (admin, no roles), Demo Admin Steward (admin + DataSteward), Demo Steward (DataSteward + DataConsumer, not admin).

AI mode - Members › Users

AI mode - Members › Online users

AI mode - Team detail › Users

AI mode - Persona › Users

AI mode - Access tab, admin only

AI mode - Access tab, admin + DataSteward

AI mode - Access tab, DataSteward + DataConsumer

Classic - Team detail › Users

Classic - Online users

Classic - Profile roles, admin + DataSteward

Screenshots: hover card and bulk-edit user picker

Hovering Demo Admin Only (admin, no other roles) on the classic team page. Before: no Roles section. After: Roles shows Admin (superuser).

Metrics bulk edit, Owners picker, searching "demo". Before: the admins show no role, or show their other role. After: both admins show Admin (superuser).

Before - user hover card

After - user hover card

Before - metrics bulk-edit owners picker

After - metrics bulk-edit owners picker

🤖 Generated with Claude Code

… Access tab does

Admin is the isAdmin flag, not a role entity. The Access tab added it as a
synthetic chip, but the user tables only read user.roles, so admins showed
no role. One helper, getUserRoleRefs, now builds the list for the Access tab
and every user table, with Admin first and rendered as text, not a link.
@Rohit0301
Rohit0301 requested a review from a team as a code owner December 4, 2026 07:34
@Rohit0301
Rohit0301 requested review from shah-harshit and removed request for a team December 4, 2026 07:34
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

The hover card hid its Roles section when an admin had no role entities,
and the bulk-edit user picker described admins by their first role or
team. Both now read the role list from getUserRoleRefs, and
formatUsersResponse keeps isAdmin from the search document.
UsersPureUtils imports moment and the API helpers, so importing the role
helper from it put them on every route that renders the user hover card,
taking ServiceDetailsPage over its bundle budget. UserRoleUtils imports
only TERM_ADMIN and types.
@gitar-bot

gitar-bot Bot commented Dec 4, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟢 Low risk

Adding a synthetic Admin label across user tables, hover cards, and the picker changes display only; it does not alter access checks or role assignments.

Adds getUserRoleRefs in utils/UsersPureUtils.ts so user tables and the Access tab show the Admin role (from the isAdmin flag) first, instead of "No role" or a missing Admin chip. 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

@Rohit0301 Rohit0301 added the To release Will cherry-pick this PR into the release branch label Dec 4, 2026
@Rohit0301
Rohit0301 merged commit 377ba23 into open-metadata:main Dec 4, 2026
30 checks passed
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.1 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

gh-bot-collate Bot commented Dec 4, 2026

Copy link
Copy Markdown

🤖 Backport to 2.1 opened as #39802 (clean cherry-pick). It merges itself once the checks pass.

@gh-bot-collate

gh-bot-collate Bot commented Dec 4, 2026

Copy link
Copy Markdown

🤖 Backport to 2.0 failed. The conflict could not be resolved, so this change is not on that branch. Resolver run.

Rohit0301 added a commit that referenced this pull request Dec 4, 2026
…oes (#39767) (#39802)

* Fixes #39766: Show the Admin role in user tables, as the Access tab does

Admin is the isAdmin flag, not a role entity. The Access tab added it as a
synthetic chip, but the user tables only read user.roles, so admins showed
no role. One helper, getUserRoleRefs, now builds the list for the Access tab
and every user table, with Admin first and rendered as text, not a link.

* Show Admin in the user hover card and the CSV bulk-edit user picker

The hover card hid its Roles section when an admin had no role entities,
and the bulk-edit user picker described admins by their first role or
team. Both now read the role list from getUserRoleRefs, and
formatUsersResponse keeps isAdmin from the search document.

* Move getUserRoleRefs into its own module to keep routes under budget

UsersPureUtils imports moment and the API helpers, so importing the role
helper from it put them on every route that renders the user hover card,
taking ServiceDetailsPage over its bundle budget. UserRoleUtils imports
only TERM_ADMIN and types.

(cherry picked from commit 377ba23)

Co-authored-by: Rohit Jain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User tables show no role for admins while the Access tab shows Admin

2 participants