MembersFinder should return invited group members of parent group
Problem
Consider the following group/project hierarchy:
+ Group A
- User 1
+ Group B
+ Project
-
User 1
belongs toGroup A
. -
Project
belongs toGroup B
. -
Group A
andGroup B
are siblings. -
Group B
invitesGroup A
. NowUser 1
is an indirect member ofProject
.
In this configuration, MembersFinder
currently does not return User 1
even when :invited_groups
is used.
Possibly related to !83214 (merged).
What does it mean for users?
ProjectMembers
GraphQL field does not return all users leading to an inconsistent autocompletion UX.
-
The new issue page uses a dedicated autocompletion finder/controller and currently returns all invited group members of a parent group.
-
The assignee dropdown of a project board uses
Project
GraphQL query andProjectMembers
field as the backend.
New issue page | Project board assignee dropdown |
---|---|
The user @johndoe1
belongs to a group invited to some-group
in the above screenshots.
Possible fix
A possible fix would be to include :shared_from_groups
when executing GroupMembersFinder
:
diff --git a/app/finders/members_finder.rb b/app/finders/members_finder.rb
index de2a4ce3518b..037437a70353 100644
--- a/app/finders/members_finder.rb
+++ b/app/finders/members_finder.rb
@@ -68,9 +68,10 @@ def group_union_members(include_relations)
end
def direct_group_members(include_descendants)
- requested_relations = [:inherited, :direct]
+ requested_relations = [:inherited, :direct, :shared_from_groups]
requested_relations << :descendants if include_descendants
- GroupMembersFinder.new(group).execute(include_relations: requested_relations).non_invite.non_minimal_access # rubocop: disable CodeReuse/Finder
+
+ GroupMembersFinder.new(group, @current_user).execute(include_relations: requested_relations).non_invite.non_minimal_access # rubocop: disable CodeReuse/Finder
end
def project_invited_groups
Edited by euko