Thanks to visit codestin.com
Credit goes to github.com

Skip to content

APIs for new user management UI #6877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

begelundmuller
Copy link
Contributor

@begelundmuller begelundmuller commented Mar 12, 2025

Changes:

  • Adds an API ListProjectsForOrganizationAndUser that an org member with read_org_members permission can use to list the projects another org member has access to.
  • Adds an API ListUsergroupsForOrganizationAndUser that an org member with read_org_members permission can use to list the user groups another org member belongs to.
  • Adds support for optionally filtering by role in the following APIs:
    • ListOrganizationMemberUsers
    • ListOrganizationMemberUsergroups
    • ListProjectMemberUsers
    • ListProjectMemberUsergroups
  • Added an include_counts option to the ListOrganizationMemberUsers API. If set, the result will contain two additional fields projects_count and usergroups_count for each member.
  • Added an include_counts option to the ListOrganizationMemberUsergroups API. If set, the result will contain a users_count field for each user group.

Contributes to #6578

Frontend integration notes:

  • To show the number of projects and groups that org members belong to, pass include_counts=true when calling ListOrganizationMemberUsers.
  • When you want to list the projects or usergroups a specific org member belongs to, use ListProjectsForOrganizationAndUser and ListUsergroupsForOrganizationAndUser. Make sure to call these lazily when the org admin drills-down for it (it's too heavy to load these eagerly for all members in the listing at once).

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@begelundmuller begelundmuller self-assigned this Mar 12, 2025
@begelundmuller begelundmuller requested a review from pjain1 March 12, 2025 20:06
@begelundmuller begelundmuller changed the title APIs for introspecting a user's projects and groups in an org APIs for new user management UI Mar 12, 2025
This was referenced Mar 13, 2025
Copy link
Member

@pjain1 pjain1 left a comment

Choose a reason for hiding this comment

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

Do we need cli for these APIs that works for superusers, looks convenient but not a blocker for this PR.

@begelundmuller
Copy link
Contributor Author

begelundmuller commented Mar 14, 2025

Do we need cli for these APIs that works for superusers, looks convenient but not a blocker for this PR.

Good point – I think I'll wait and see if anyone requests it, then do it in a follow up PR if needed.

@begelundmuller begelundmuller merged commit 679297c into main Mar 14, 2025
13 checks passed
@begelundmuller begelundmuller deleted the begelundmuller/introspect-users-projects-groups-apis branch March 14, 2025 09:56
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.

2 participants