Invited from field fails to show correct source for users with inherited group membership

Summary

When users inherit group membership through a hierarchy of groups and a subgroup is then invited to a project via group invite, the project's Group members page incorrectly displays only the top-level parent group as the source of the user's access, rather than showing the complete inheritance path or the original source group

Steps to Reproduce

  1. Create a user test and add them to the test group
  2. Ensure the test/banking subgroup inherits users from the test parent group
  3. Add the test/banking group to deploy/test/banking/banking (another top-level group's project)
  4. Navigate to the deploy/test/banking/banking group members page
  5. Observe the inheritance information for user test

Current Behavior:

User test displays Source: Invited from test, which provides incomplete information about the inheritance chain.

Expected Behavior:

User test should display Source: Invited from test/banking to show the complete invited subgroup hierarchy.

Impact

This makes it difficult to understand the actual permission inheritance and could lead to confusion about access management.

Edited by 🤖 GitLab Bot 🤖