Skip to content

Add full User and Groups lists to Access page - #3211

Open
charliepark wants to merge 92 commits into
mainfrom
full_user_group_lists_consolidated
Open

charliepark wants to merge 92 commits into
mainfrom
full_user_group_lists_consolidated

Conversation

@charliepark

@charliepark charliepark commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

The screenshots at the top are the "before"; scroll down to "In Issue #2887" to see the screenshots of this PR's code.
Currently, the Silo Access and Project Access page don't show all users, except when you open up the "Add user or group" form and access the dropdown:
Screenshot 2026-06-26 at 5 20 28 PM
Screenshot 2026-06-26 at 5 20 41 PM
Screenshot 2026-06-26 at 5 20 52 PM
Screenshot 2026-06-26 at 5 20 59 PM

In issue #2887, @askfongjojo requested a view where all users and groups would be displayed. This PR does that, adding a tabbed interface to show Groups / Users, and, then, on those pages, shows all groups and users.

Here we see the Silo index page for Groups:
Screenshot 2026-11-18 at 3 11 07 PM

And the tab for Users on the Silo:
Screenshot 2026-11-18 at 3 11 20 PM

And the equivalent Project Access page for Groups:
Screenshot 2026-11-18 at 3 19 59 PM

The overview pages show the user or group's "effective role", which is more generally what someone wants to know — "What is it that this user can do within this project (including inherited silo roles, group-assigned roles, etc.)?" — rather than just "What role have they been assigned within this project?". So, in this case, we see that the operator can see the effective role on the overview page, or click through to see Hannah's suite of roles in the side modal.

(Here, we see Hannah's effective role, of ADMIN …)
Screenshot 2026-11-18 at 3 24 43 PM
(… but if we click in to the side modal, we can see that she also has a project role of LIMITED_COLLABORATOR …)
Screenshot 2026-11-18 at 3 25 01 PM

If the operator wants to see the specific policy for that project, the project and silo access pages also show the policy for that silo/project, via the "show policy" button in the top right (where we see Hannah's LIMITED_COLLABORATOR role assignment):
Screenshot 2026-11-18 at 3 36 30 PM
The operator can then click through to the user/group's page to see the side modal for that user/group, showing all roles. All role edits / removals happen on the specific user/group page (side modal), where the operator has the full context around that user/group.

When a user has just one admin role (whether directly assigned or via a group) and they then move to change their own permission level (or the group's permission level), they get a warning with a required action in order to remove that role:
Screenshot 2026-11-18 at 3 14 51 PM
Screenshot 2026-11-18 at 3 15 10 PM
This warning does not show up if the user has multiple admin roles.

Another restriction to note is that a silo-scoped role assignment can't be modified from the Project Access page:
Screenshot 2026-11-18 at 3 14 00 PM

One ongoing situation that I want to mention is that we don't have a way to order / filter the responses from the API, and the default ordering from the API is by User ID. Instead of having pagination with 50 users per page, we select all-ish users (1,000) and then sort them by name on the client. This deviates from the vanilla API response, but gives a more useful listing of users. I checked with Will about whether that 1,000 user cap would be a problem, and he said that in the far future it might be something to address, but that there are no current customers where that limit would be problematic, based on how they configure users/silos.

Closes #2887
Closes #1146
Closes #1359

@charliepark

Copy link
Copy Markdown
Contributor Author

The CI test will fail until I merge this branch, but holding off until we're sure it's the right path, to reduce noise on Omicron. https://github.com/oxidecomputer/omicron/tree/routes-for-access-v2

@charliepark

Copy link
Copy Markdown
Contributor Author

Nexus updates are in oxidecomputer/omicron#11700

@charliepark

charliepark commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Have added a modal to highlight the policy at the silo / project level:
Screenshot 2026-11-03 at 6 28 37 PM
(This is essentially what the current Silo Access / Project Access page shows.)

@charliepark

Copy link
Copy Markdown
Contributor Author

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings marked 🟡 are optional suggestions and need no follow-up push.

Comment thread app/routes.ts Resolved
Comment thread app/components/access/policy-scope.ts Resolved
@charliepark

charliepark commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Prompted by the Claude review from yesterday, I also have some work in oxidecomputer/omicron#11713 looking at doing a better job cleaning up role rows when deleting users and groups.

charliepark added a commit to oxidecomputer/oxide.ts that referenced this pull request Nov 16, 2026
…ses (#394)

Closes #386

Mock handlers for endpoints without a JSON success type had the return
type `Promisable<StatusCode>`, but some of those endpoints need headers
or a body in the response. Console's `supportBundleHead` handler returns
an `HttpResponse` with `Content-Type` and `Content-Length`, and it
needed a `@ts-expect-error` to do that. (See
[here](https://github.com/oxidecomputer/console/blob/94b120278fb515269ab97a09b26020e98a862df0/mock-api/msw/handlers.ts#L2133-L2136).)
The dispatcher already passes `Response` instances through at runtime,
so accepting only the StatusCode (in the handlers where we needed the
response) was too narrow.

The generator now makes a distinction between two cases. Operations with
a 204 success response keep `Promisable<StatusCode>`. Operations that
respond with something other than JSON or a 204 (binary download, HEAD,
redirect) get `Promisable<StatusOrResponse>`, where `StatusOrResponse`
is a new alias for `StatusCode | Response` in the generated file.

To support this, `Operation` now has a `successCode` field (the key of
the success response in the spec, e.g. `"200"`, `"204"`, `"default"`),
and the MSW generator checks `successCode === "204"`. `getOperations`
now throws if an operation does not have exactly one non-error response;
this replaces `getSuccessResponse`, which picked the first of 200, 201,
202 and 204 without a check. Every operation in the current Nexus spec
has exactly one, so the generated client is unchanged.

In the current Nexus spec, nine handlers get the new result type; others
are unchanged.
- `supportBundleHead`, `supportBundleHeadFile`
- `supportBundleDownload`, `supportBundleDownloadFile`,
`supportBundleIndex`
- `deviceAuthRequest`, `deviceAccessToken`
- `loginSaml`, `instanceSerialConsoleStream`

When we merge this, (and update to the new version in console) we'll be
able to remove the `@ts-expect-error`
[here](https://github.com/oxidecomputer/console/blob/94b120278fb515269ab97a09b26020e98a862df0/mock-api/msw/handlers.ts#L2133-L2136).

I checked this locally, as I'm working on an OMICRON_VERSION bump as a
part of oxidecomputer/console#3211 and I hit an
issue with new missing handlers that weren't getting caught by `npm run
tsc` until I dug into this. To test: linked the local build of
`openapi-gen-ts` (this code) into local console's `node_modules`, then
ran `npm run gen-api` and `npm run tsc`. It caught the missing handlers
and then `tsc` passed once I added them in.

This also bumps the version to 0.17.0, as the generated handler types
change.
david-crespo pushed a commit to oxidecomputer/omicron that referenced this pull request Nov 17, 2026
…ed (#11713)

In working on a console PR
(oxidecomputer/console#3211) I discovered that
#8605 was still open.
(#9276 handled deletion of
role assignments for SCIM-managed users / groups, but not for local
ones). This PR adds a method that handles the deletion of role
assignments for locally-managed users and groups, and calls it when the
user / group is deleted. It also deletes silo-scoped role assignments
when a silo is deleted.

Note: there is no method to delete groups locally, but deleting a silo
without addressing the roles would leave some orphaned rows, so this
code cleans up the roles during the silo deletion process.

"But wait!", I hear you say, "what about the orphaned rows from users
that have already been deleted from the silo? Isn't that what prompted
#8605 in the first
place?" Good question. That is outside the scope of this PR, but the
robot suggests there's a migration from before that covers similar
territory: `schema/crdb/cleanup-orphaned-subnet-pool-silo-links`
(version 248):
```sql
SET LOCAL disallow_full_table_scans = off;

DELETE FROM omicron.public.subnet_pool_silo_link
WHERE subnet_pool_id NOT IN (
    SELECT id FROM omicron.public.subnet_pool WHERE time_deleted IS NULL
);
```
So that's something we can talk through separately.

Unrelated, but I also came across some old uncalled code in
`silo_group_delete`; this PR removes that method as well.

#8605 will still be open after this merges. We will need to clean up the
leftover rows, per the note above, to fully close that issue.
@charliepark

Copy link
Copy Markdown
Contributor Author

@claude review

Comment thread app/pages/SiloUsersGroupsPage.tsx Resolved

This branch was successfully deployed

1 active deployment
Preview — ac185732 Deployed Nov 21, 2026 by vercel[bot]
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.

Want user and group list for silo admins v1 Access & IAM - tabs for all, users, groups Group detail page listing users

2 participants