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

  1. new search filter using_license_seat=true added to api/v4/users endpoint
  2. filter only applicable with admin access
  3. using_license_seat filter returns expected result when combined with other filters, e.g. search=, order_by=, and pagination filters.
  4. does not return duplicate records when user belongs different billable projects/groups
  5. result does not include inactive, ghost and bot users.
  6. guest user result is based on subscription's feature
  7. when filter set to using_license_seat=false it returns all users for admin
  8. does not affect existing behavior of POST, GET request to api/v4/users when filter is not applied
Edited by Chloe Liu