blob: 7b68b435f14f522bc133bbec9cbbdef889e7311a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# frozen_string_literal: true
module Groups
class ParticipantsService < Groups::BaseService
include Gitlab::Utils::StrongMemoize
include Users::ParticipableService
def execute(noteable)
@noteable = noteable
participants =
noteable_owner +
participants_in_noteable +
all_members +
group_hierarchy_users +
groups
render_participants_as_hash(participants.uniq)
end
private
def all_members
return [] if group.nil? || Feature.enabled?(:disable_all_mention)
[{ username: "all", name: "All Group Members", count: group.users_count }]
end
def group_hierarchy_users
return [] unless group
sorted(Autocomplete::GroupUsersFinder.new(group: group).execute)
end
end
end
|