Show a user's "highest role"
Problem to solve
When viewing user statistics through admin/dashboard/stats
, we break down users by their highest permissions level in a group or project on the instance. This is important to admins, since this view can give them a summary of how permissions are distributed on the instance - and helps educate them on users they might be able to block, in an effort to manage seat utilization.
Also, GitLab started to treat roles differently depending on the license by making Guest users not count against the license count in Ultimate. If I'm an administrator managing thousands of users in a GitLab Ultimate instance, I want to be able to quickly understand a user's role and whether or not they're taking up a seat. We can't assume that a user with a state
of active
is actually taking up a seat.
If I wanted to trace the Users Statistics page at admin/dashboard/stats
to a particular group of users (of my 100 active users, who are the 10 users with "highest role maintainer"?), it's currently a challenge. We don't show this when viewing a user in the admin's user view, and we don't return this through the Users API.
Proposal
- Add
highest_role
to the Users API. This attribute should reflect the user's highest role on the instance, with access levels defined by https://docs.gitlab.com/ee/api/members.html. Update this attribute for users on a regular basis. - Add
highest_role
to the admin users view (admin/users/foo
).
We should do this for groups and group owners as well (for GitLab.com).