Add “Pending owner approval” badge for members
What does this MR do and why?
Relates to #334292 (closed)
A user can be Pending owner approval in 2 scenarios:
- Gitlab instance-wide root approval (steps to reproduce below)
- User Cap: with the
User Capsetting, admins can prevent accidental user overages, so when the group is at limit of number of users, they should be on theinvitedtab (!70675 (merged)), withPending Owner Approvalstatus.
Screenshots or screen recordings
In my screenshots, I have 3 users in the invited tab:
- Arnulfo Jakubowski (
@valeria): Existing user, added to the group when UserCap was reached (steps to reproduce below) new-team-member1@gitlab.com: New Member, already registered, but still pending because UserCap was reachednew-team-member2@gitlab.com: New Member, but not registered yet. This will receive anAwaiting user signupbadge to be introduced on this MR: !65410 (closed)
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
Case 1: Gitlab instance-wide root approval
In order to have this behavior in your GitLab local instance, you have to enable this option in admin:
- Login as
root - Navigate to
/admin/application_settings/general - Expand
Sign-up restrictionssection - Make sure
Require admin approval for new sign-upsis checked.
Now let's get someone with Pending owner approval badge:
- Go to the browser, and navigate to your group:
groups/my_group/-/group_members - Invite a user via email (e.g. new-team-member1@gitlab.com)
- In another browser/session, register the user.
- You'll receive this message after successful registration:
You have signed up successfully. However, we could not sign you in because your account is awaiting approval from your GitLab administrator - Here the team member should be in the invited tab,
User.stateisblocked_pending_approval
- You'll receive this message after successful registration:
- You should see the
Pending owner approvalbadge on theinvitedcolumn of the table
Case 2: SaaS UserCap
- Activate Feature Flag using
rails cmy_group = Group.find(<group_id>)Feature.enable(:saas_user_caps, my_group)
- On the same
rails consolesession, check user capmy_group.user_cap_reached?. Output should befalsemy_group.namespace_settings.update!(new_user_signups_cap: my_group.group_members.count)my_group.user_cap_reached?. Output should betrue
- Go to the browser, and navigate to
groups/my_group/-/group_members - Add a new member (e.g.
@valeriafrom the seeded data)- Now
GroupMember.stateis1 (STATE_AWAITING)and the user is pending owner approval
- Now
- You should see the
Pending owner approvalbadge on theinvitedcolumn of the table
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- I have evaluated the MR acceptance checklist for this MR.
Edited by Sheldon Led

