Skip to content

Don't allow last owner and current user to be awaiting

Nicolas Dular requested to merge nd/disallow-last-owner-awaiting into master

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.

Screenshots or screen recordings

Screenshot_2022-05-16_at_15.50.51

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)
  1. Add two owners to the group you want to try it on
  2. Go to the Usage Quota page (Group -> Settings -> Usage Quota)
  3. Toggle one onwer "off"
  4. 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.

Edited by Nicolas Dular

Merge request reports