Skip to content

Disable user cap input if shared externally

Vijay Hawoldar requested to merge vij-disable-cap-external into master

What does this MR do and why?

This MR disables the Group user cap setting input when the group or one of it's descendants are shared externally (outside of it's hierarchy).

This satisfies the requirements stipulated in #342227 (closed) and the discussion here

We already prevent sharing externally if the user cap is enabled, this MR covers the usecase where they have already been shared.

TLDR; a user cap is not useful when a group has been shared externally because the owner has no control over billable members being added to the groups it was shared to.

How to set up and validate locally

  1. Ensure the feature is available locally:
      Feature.enable(:saas_user_caps)
  2. Modify Gitlab.com? to return true (you may need to restart your GDK instance for this to take effect)
  3. Check the settings for a root group and view the user cap input (http://host/groups/your-group/-/edit > Permissions and group features)
  4. Invite another root group into the root group's (or one of it's subgroups) hierarchy (http://host/groups/your-group/-/group_members > Invite group)
  5. View the settings again and they should not be available to edit
  6. View the same settings for a sub-group to confirm user cap input is not visible
enabled disabled
Screenshot_2022-01-12_at_11.00.38 Screenshot_2022-01-12_at_11.00.08

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 Vijay Hawoldar

Merge request reports