[Self-managed] Give Admins control over accidental user overages via a `User Cap` admin setting
## Problem It is very easy for a self-managed instance to exceed their licensed user count through integrated LDAP systems, a lack of awareness of their current usage and the fact that we do not block additional user participation once the subscription limit has been reached. ### Proposal Add an optional "User Cap" setting in the admin settings of self-managed instances and in group settings of GitLab.com instances. #### Feature Characteristics - This setting is off-by-default and opt-in only. - The user should be able to specify a max user count value. - When the max is reached, users who are subsequently added or request access will go into a `blocked_pending_approval` state. [_reference_](https://gitlab.com/gitlab-org/gitlab/-/issues/14432#note_406869271) - Users are still able to register an account but now an email is sent to the admin for approval. - The admin/group owner should be able approve individual user requests while the max value has been reached. - The admin/group owner will need to increase the max value if they would like open registration to continue. ### Designs - For the pending members feature, we're going to utilize this design: https://gitlab.com/groups/gitlab-org/-/uploads/52b8cb4df563dc7175b838ac705ffd16/Group_52.png, borrowed from https://gitlab.com/gitlab-org/gitlab/-/issues/21648 - For the settings feature, tbd UX work ## Actions #### UX - [x] Admin panel/group settings feature gitlab#244486 #### Technical Writing - [x] Do we need another name for this since `Max users` is very specific to subscribed user count? #244487 - Per [this comment](https://gitlab.com/groups/gitlab-org/-/epics/4315#note_408724791) we are using `User Cap` for this feature - [x] Docs update to document the feature https://gitlab.com/gitlab-org/gitlab/-/issues/244487 #### Development - [x] Alert to admin/owners alerting them that the limit has been reached gitlab#244493 - [x] Put members into pending state once limit is reached gitlab#244519 - [x] Send email notification to admin/group owner gitlab#244529 - [x] Create the setting gitlab#211390 - [ ] Ensure the Approval of adding a member from Pending state is tracked in the Audit Logs #### Product - [ ] Should this be included in the Release Post? - [ ] Communication to sales, CS & support for large customers - [ ] Make data team aware of new field
epic