Groups dashboard displays incorrect groups
What does this MR do and why?
Closes #506280
The group dashboard does not properly display subgroups when a member of a top level group with minimal access permissions. This is because the subgroup_count property has a permission check and is not returned if the user does not have permissions. This MR exposes a new boolean property called has_subgroups that does not have permission checks and uses that on the frontend.
This MR:
- Expose a
has_subgroupsproperty - Updates the frontend to use this property instead of
subgroup_count
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
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- In your
gitlab-development-kitdirectory create aenv.runitfile - Add the following to it:
export FOSS_ONLY=0
export GITLAB_SIMULATE_SAAS=1
- Restart GDK
- Go to http://gdk.test:3000/admin/groups/new and create a group
- Edit that group in the admin area and choose
Ultimatefrom thePlandropdown. If you don't see this dropdown you first need to check theAllow use of licensed EE featuresin http://gdk.test:3000/admin/application_settings/general - Create two groups as children of the top level group:
sub-group Aandsub-group B - Create a user, add them to the top level group with
minimal accesspermissions - Add the user to
sub-group Aasowner - Share
sub-group Bwithsub-group A - Login as the new user and visit the groups dashboard
- Before the fix: observe that only the top level group is displayed, and it's not possible to navigate to sub-groups
- After the fix: when clicked, the top level group will expand to display the sub-groups
Edited by Peter Hegman

