Disable user cap input if shared externally
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
- Ensure the feature is available locally:
Feature.enable(:saas_user_caps)
- Modify Gitlab.com? to return
true
(you may need to restart your GDK instance for this to take effect) - Check the settings for a root group and view the user cap input (http://host/groups/your-group/-/edit > Permissions and group features)
- 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)
- View the settings again and they should not be available to edit
- View the same settings for a sub-group to confirm user cap input is not visible
enabled | disabled |
---|---|
![]() |
![]() |
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 Vijay Hawoldar