Skip to content

Add "GET /groups/:id/enterprise_users/:user_id" API endpoint

Jio Castillo requested to merge add_get_single_enterprise_user into master

What does this MR do and why?

Adds the "GET /groups/:id/enterprise_users/:user_id" API endpoint that allows top-level group Owners to get a single enterprise user's details

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Make sure the GitLab instance simulates or a SaaS instance since Enterprise Users is a SaaS feature
  2. Configure "Automatic claims of enterprise users". For testing purposes on the local environment you can claim the user manually from the Rails console:
User.find_by_username('USERNAME').user_detail.update(enterprise_group_id: GROUP_ID)
  1. Request the API endpoint as a group Owner. The enterprise user should be listed in the response with attributes as per the docs.
  • curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/GROUP_ID/enterprise_users/USER_ID
Edited by Bogdan Denkovych

Merge request reports

Loading