Hide `New subgroup` button if visibility is restricted
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 |
---|---|
How to set up and validate locally
- Create a private group
- Invite a user as an owner
- Go the admin area and check
Private
in theRestricted visibility levels
setting - Find the user you invited to the group in
/admin/users
and impersonate them - Go to the private group
- Verify that you're not seeing the
New subgroup
button🎉 - 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