Skip to content

Show UI management areas to endpoint administrators#203

Merged
rbardaji merged 1 commit into
mainfrom
fix/202-ui-endpoint-admin-role
Jul 25, 2026
Merged

Show UI management areas to endpoint administrators#203
rbardaji merged 1 commit into
mainfrom
fix/202-ui-endpoint-admin-role

Conversation

@rbardaji

Copy link
Copy Markdown
Collaborator

Closes #202

Problem

The admin dashboard and the access-request review page were shown only to holders of the platform-wide ndp_admin role. A user who administers this endpoint — but is not a platform admin — did not see them, even though the API treats them as an administrator.

The endpoint-scoped admin role the identity provider issues is group:{endpoint-uuid}:admin. The UI decided admin status with a client-side check that matched only ndp_admin or names ending in _admin; the canonical form ends in :admin and was missed. So the person who administers an endpoint was locked out of that endpoint's own management screens.

Reported from the field alongside the test-token issue.

Fix

The backend already reports effective_role on /user/info, resolving every admin role form including the endpoint-scoped one. The UI now trusts that value instead of re-deriving admin status from role strings.

The helper moved to ui/src/services/roles.js so it can be unit-tested without importing the axios client (whose ESM build the CRA jest transform rejects). The role-string fallback, for a backend old enough not to send effective_role, now also recognizes the :admin form.

Verified

  • New ui/src/services/roles.test.js: 7 cases covering the canonical, legacy and platform admin roles, the effective_role path, and malformed input.
  • Full UI suite: 37 passed. App.test.js fails identically on main (pre-existing module-resolution issue, untouched here).
  • UI compiles (Compiled successfully).

UI only — no API, route or payload changes.

Note on versioning

Bumps to 0.33.2, assuming #201 (0.33.1) merges first. If merge order differs, the version line and CHANGELOG will need a trivial rebase.

The admin dashboard and access-request review page were gated on a
client-side check that recognized only ndp_admin or role names ending in
_admin. The role an endpoint administrator actually holds is the
canonical group:{uuid}:admin, which ends in :admin, so endpoint admins
were locked out of their own endpoint's management screens even though
the API treats them as administrators.

The backend already reports effective_role, resolving every admin role
form including the endpoint-scoped one. The UI now trusts that value
instead of re-deriving admin status from role strings. The helper moved
to services/roles.js so it can be unit tested without importing the
axios client, and the string fallback (for an older backend) now also
recognizes the :admin form.

Closes #202
@rbardaji
rbardaji force-pushed the fix/202-ui-endpoint-admin-role branch from 8670da3 to 4eefdca Compare July 25, 2026 07:13
@rbardaji
rbardaji merged commit 584a9ef into main Jul 25, 2026
1 check passed
@rbardaji
rbardaji deleted the fix/202-ui-endpoint-admin-role branch July 25, 2026 07:14
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.

UI grants management access only to platform admins, ignoring endpoint admin role

1 participant