Skip to content

Add `/groups/owned` API endpoint

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/ownedend point (together with the SUDO functionality for admins), is the fist step to implement this process.
This merge request provides that endpoint together with its tests and also tests for /projects/owned that were missing.

Merge request reports