blob: 458eaec4e2e0d5165c54d17b9b8e27385bf58c13 (
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
|
# frozen_string_literal: true
module Projects
class ParticipantsService < BaseService
include Users::ParticipableService
def execute(noteable)
@noteable = noteable
participants =
noteable_owner +
participants_in_noteable +
all_members +
groups +
project_members
render_participants_as_hash(participants.uniq)
end
def project_members
@project_members ||= sorted(project.authorized_users)
end
def all_members
return [] if Feature.enabled?(:disable_all_mention)
[{ username: "all", name: "All Project and Group Members", count: project_members.count }]
end
end
end
|