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
- Create a new endpoint in
lib/api/groups.rbcalledgroups/:id/invited_groups. - Reuse the existing code to add a
relationparam that takesdirect,indirectas value to filter group links, if the param is not present we returngroup.shared_with_group_links.of_ancestors_and_selfas in the linked code. - Add a
searchparam. - 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.
- Repeat the above implementation for projects.
Ensure the new endpoints are rate limited.
Edited by Christina Lohr