Add "Is using license seat:" to Users API
Problem to solve
When auditing my users, I want to run a function in on an API, so I can get a list of users taking up a license seat (billable users).
Task:
-
Add parameter to the GitLab admin users API that would confirm whether a user is using a license seat (whether the user is billable). i.e using_license_seat
For reference, confirming the users that should take up a license seat: https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/models/ee/user.rb#L271
Intended users
Permissions and Security
Administrator
Possible future iterations
- A way to look up billable users and their activity to determine whether the user is inactive
- A report of inactive users
- A way to bulk block/delete/deactivate the inactive users
Testing & Availability
- new search filter
using_license_seat=true
added toapi/v4/users
endpoint - filter only applicable with admin access
-
using_license_seat
filter returns expected result when combined with other filters, e.g.search=
,order_by=
, and pagination filters. - does not return duplicate records when user belongs different billable projects/groups
- result does not include inactive, ghost and bot users.
- guest user result is based on subscription's feature
- when filter set to
using_license_seat=false
it returns all users for admin - does not affect existing behavior of
POST
,GET
request toapi/v4/users
when filter is not applied
Edited by Chloe Liu