Skip to content
Snippets Groups Projects

Disable user cap input if shared externally

Merged 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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Vijay Hawoldar added 1 commit

    added 1 commit

    • 157512a4 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Author Maintainer

    @sselhorn would you mind taking a look at !76130 (comment 808882711) when you have a chance? I've applied @psimyn's suggestion but if you think it needs to change again, just let me know!

  • Please register or sign in to reply
    Loading