Add API endpoint to get users without projects
Problem to solve
In the Admin UI, on the Users page (/admin/users), there is a tab titled Without Projects
that displays the users without projects on the instance. In the Users API, there is no endpoint available to get all users without projects. This proposal is requesting the addition of an API endpoint to get all users without projects.
Requested by customer: https://gitlab.zendesk.com/agent/tickets/123704 (internal use only)
Intended users
GitLab administrators using the API to get the users without projects they see in the Admin UI
Further details
The admin view retrieves users without projects via User.without_projects
. That scope is defined in the user model, and can be used to create an endpoint in the Users API library to get all users without projects. This endpoint would be available to admins only.
Proposal
Add an API endpoint in the Users API that retrieves all users without projects (matching what is seen in the Admin UI)
Permissions and Security
Restrict this to admins only, as this is only available in the admin section of the UI
Documentation
Users API documentation: https://docs.gitlab.com/ee/api/users.html
Testing
Add tests for the new API endpoint: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/spec/requests/api/users_spec.rb
What does success look like, and how can we measure that?
Admins can retrieve the users without projects with one API call.