Skip to content

Create an API to list groups invited to a group or project

We want to create an API to return the equivalent of https://gitlab.com/groups/<full path>/-/group_members?tab=groups and https://gitlab.com/groups/project/\\\<full path\\\>/-/project_members?tab=groups.

Implementation plan

  1. Create a new endpoint in lib/api/groups.rb called groups/:id/invited_groups.
  2. Reuse the existing code to add a relation param that takes direct, indirect as value to filter group links, if the param is not present we return group.shared_with_group_links.of_ancestors_and_self as in the linked code.
  3. Add a search param.
  4. Make sure we only return the links where the current user has access and masking the group info wherever required. See !134623 (diffs) for more info on this.
  5. Repeat the above implementation for projects.

Ensure the new endpoints are rate limited.

Edited by Christina Lohr