Skip to content

Add group lists to member endpoints#10828

Open
charliepark wants to merge 2 commits into
mainfrom
add_groups_to_user_endpoint
Open

Add group lists to member endpoints#10828
charliepark wants to merge 2 commits into
mainfrom
add_groups_to_user_endpoint

Conversation

@charliepark

@charliepark charliepark commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This adds a groups field to the User view in the external API, so that when you fetch a user (or list users), you get back the list of groups that user belongs to.

This was initially prompted by console#3211, where we need to easily pull each user's groups, for determining their effective role, factoring in both their inherited role (from the silo), their assigned role (from the project), and their group memberships (from both the silo and the project). Without the changes in this PR, we calculate that by running a query for each group, then finding the group membership, then mapping it to each user. So I think this is an improvement. Downside is that it runs the additional group bundling on every user endpoint.

One question @david-crespo and I talked through a bit, though we didn't get deep into it, was whether the shape of the group should just be … a group … as opposed to what we have in this PR, which is an object of just the group name (a string) and the id (a UUID). The other elements of a Group object are the silo, which is the same as the user's silo, then the created_at and updated_at timstamps, which I'm not sure we'll use. With all of that, I think just the ID and name is fine, but I'm open to alternate takes.

@charliepark
charliepark marked this pull request as draft July 15, 2026 21:46
@charliepark
charliepark marked this pull request as ready for review July 15, 2026 23:28
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