Commit 5f3db4c5 authored by Lucas Zampieri's avatar Lucas Zampieri

Groups Members all API fix

groups/:id/members/all would not return users of groups invited to the
current group.
Added relation to seek for users from :shared_with_groups within
current_group, similar to how projects do it in project_invited_groups
of member_finder.rb.
Changelog: fixed
Signed-off-by: default avatarLucas Zampieri <lzampier@redhat.com>
parent 92b65146
......@@ -58,6 +58,8 @@ class GroupMembersFinder < UnionFinder
find_union([group.ancestors, group.descendants], Group)
when [:descendants, :direct, :inherited]
group.self_and_hierarchy
when [:direct, :inherited, :shared_with_groups]
find_union([group.self_and_ancestors, group.shared_with_groups], Group)
else
nil
end
......
......@@ -50,7 +50,7 @@ module API
end
def find_all_members_for_group(group)
GroupMembersFinder.new(group).execute
GroupMembersFinder.new(group).execute(include_relations: [:inherited, :direct, :shared_with_groups])
end
def present_members(members)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment