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_subgroups property
  • 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
Screenshot_2024-12-04_at_8.46.19_AM Screenshot_2024-12-04_at_8.44.13_AM

How to set up and validate locally

  1. In your gitlab-development-kit directory create a env.runit file
  2. Add the following to it:
export FOSS_ONLY=0
export GITLAB_SIMULATE_SAAS=1
  1. Restart GDK
  2. Go to http://gdk.test:3000/admin/groups/new and create a group
  3. Edit that group in the admin area and choose Ultimate from the Plan dropdown. If you don't see this dropdown you first need to check the Allow use of licensed EE features in http://gdk.test:3000/admin/application_settings/general
  4. Create two groups as children of the top level group: sub-group A and sub-group B
  5. Create a user, add them to the top level group with minimal access permissions
  6. Add the user to sub-group A as owner
  7. Share sub-group B with sub-group A
  8. 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

Merge request reports

Loading