Cannot invite groups to project as inherited owner in source group

Summary

It appears that a user even with the Owner role in a project, cannot invite a group to be a member of that project if their membership in that group is via inheritance, and not a direct membership (of any role level).

Current behavior / Steps to replicate

An example is as below:

  1. On GitLab.com (18.6.0-pre c2ed231f1fe), we have a user named test-user
  2. The user is an Owner in the project at example-group/example-subgroup/example-project via Direct Membership
  3. The user is an Owner in the group example-group/example-subgroup/engineering-team via Direct Membership
  4. The user is a Reporter in the group example-group/security via Inheritance of the fact that the example-group/example-subgroup/engineering-team group is invited as a Reporter to the example-group/security group.
  5. When this user tries to invite the example-group/security group into the example-group/example-subgroup/example-project project, that group will not appear in the drop-down list at all as a group that can be invited. However - if we invite the test-user user to be a Direct Member of example-group/security at any role level rather than via the group invite of example-group/example-subgroup/engineering-team into that group - Then you'll see the example-group/security group in the drop-down list, and you can invite it to the project.

What is the desired behavior?

It's unclear if this is intended behavior or a bug, so we need to align on that first. The closest information I've seen in the documentation is:

Only direct members of the invited group get access to the shared group, not inherited, shared or subgroup members

However this is specific to sharing groups-to-groups, and not groups-to-projects.

Edited by 🤖 GitLab Bot 🤖