Adjust group sharing settings for restricted access and user cap
Resolves Stop disabling project sharing within the same ... (#488451 - closed).
What does this MR do and why?
When seat controls are enabled (user cap or restricted access), GitLab was automatically enabling two settings:
-
prevent_sharing_groups_outside_hierarchy- Prevents inviting groups from outside the hierarchy -
share_with_group_lock- Prevents sharing projects with all groups (internal or external)
This MR changes the behavior to only automatically enable prevent_sharing_groups_outside_hierarchy, while allowing share_with_group_lock to be independently configured.
References
Screenshots or screen recordings
| Before | After |
|---|---|
|
|
How to set up and validate locally
User cap
- Create a test group
- Go to Settings > General > Permissions and group features
- Under "Seat control", select "Set user cap" and set any value
- Press "Save changes"
- In "Permissions", verify:
- "Members cannot invite groups outside of <group> and its subgroups" is checked
- "Projects in <group> cannot be shared with other groups" is unchecked
- You can manually check or uncheck "Projects in <group> cannot be shared with other groups" and it persists
Restricted access
- Ensure your test group has a paid subscription
- Go to Settings > General > Permissions and group features
- Under "Seat control", select "Restricted access"
- Press "Save changes"
- In "Permissions", verify:
- "Members cannot invite groups outside of <group> and its subgroups" is checked
- "Projects in <group> cannot be shared with other groups" is unchecked
- You can manually check or uncheck "Projects in <group> cannot be shared with other groups" and it persists
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Paulo Barros

