Add api endpoint `/groups/owned`
What does this MR do?
This merge request provides the /groups/owned
endpoint together with its tests and also tests for /projects/owned
that were missing.
Moved from gitlab-org/gitlab-ee!821
Why was this MR needed?
GitLab current's API implementation provides the endpoint /projects/owned
that retrieves projects owned by the authenticated user. With this information it is possible to deduce which are personal projects or groups projects (via the namespace
-> owner_id
fields ), thus get the owned groups information. However, this method requires an intermediate filtering to get the owned groups from the owned projects and, in case of an empty group, it will be skipped and never returned.
To have access to this information is relevant for the final users but also for admins: in big deployments where GitLab users are coming and leaving in sync with an Active Directory (blocked in AD thus blocked in GitLab when the user leaves the organization), resources, being personal projects or groups, might end up orphan.
In order to perform an appropriate account and resource management, user's resources have to be queried and reassigned to the appropriate person when they leave the organization.
To have /groups/owned
end point (together with the SUDO
functionality for admins), is the fist step to implement this process.
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together