Commit b1bd836a authored by Lucas Zampieri's avatar Lucas Zampieri

Limit invited_group search to public or visible to user

Added `public_or_visible_to_user(:user)` to group.shared_with_group
query to limit query scope, as is done ton members_finder.rb:76 for the
project side.
Changelog: fixed
Signed-off-by: default avatarLucas Zampieri <lzampier@redhat.com>
parent 26dd0d4d
......@@ -60,7 +60,7 @@ class GroupMembersFinder < UnionFinder
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)
find_union([group.self_and_ancestors, group.shared_with_groups.public_or_visible_to_user(user)], Group)
else
nil
end
......
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