Skip to content

Hide `New subgroup` button if visibility is restricted

Bojan Marjanovic requested to merge bojan/add-new-group-policy into master

What does this MR do and why?

Based on Remove `New subgroup` button in group overview ... (#390613 - closed)

We hide the New subgroup button for non-admin users of a private group when the Private checkbox is checked in the Restricted visibility levels field in the admin area.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
image image
image image

How to set up and validate locally

  1. Create a private group
  2. Invite a user as an owner
  3. Go the admin area and check Private in the Restricted visibility levels setting
  4. Find the user you invited to the group in /admin/users and impersonate them
  5. Go to the private group
  6. Verify that you're not seeing the New subgroup button 🎉
  7. Verify that create subgroup URL is not accessible, e.g. http://gdk.test:3000/groups/new?parent_id=123#create-group-pane 🎉
Edited by Bojan Marjanovic

Merge request reports