Don't allow last owner and current user to be awaiting
What does this MR do and why?
This makes sure that the last owner can't be set to awaiting
when
changing the membership_state. It is required as otherwise a group can
no longer be managed.
It also prevents the current user from setting themselves to be awaiting.
It also allows to remove awaiting users via the Usage Quota page.
- Part of https://gitlab.com/gitlab-org/gitlab/-/issues/352638
- No changelog because it's behind the feature flag
free_user_cap
.
Screenshots or screen recordings
How to set up and validate locally
export GITLAB_SIMULATE_SAAS=1
bin/rails c
ApplicationSetting.first.update(check_namespace_plan: true)
Feature.enable(:free_user_cap)
- Add two owners to the group you want to try it on
- Go to the Usage Quota page (Group -> Settings -> Usage Quota)
- Toggle one onwer "off"
- You should no longer be allowed to toggle off the last owner
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 Nicolas Dular