blob: db05920678e0ab601b36934281f25d0374bd3fa6 (
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
|
# frozen_string_literal: true
module IssueLinks
class CreateService < IssuableLinks::CreateService
include IncidentManagement::UsageData
def linkable_issuables(issues)
@linkable_issuables ||= issues.select { |issue| can?(current_user, :admin_issue_link, issue) }
end
def previous_related_issuables
@related_issues ||= issuable.related_issues(current_user).to_a
end
private
def readonly_issuables(issuables)
@readonly_issuables ||= issuables.select { |issuable| issuable.readable_by?(current_user) }
end
def track_event
track_incident_action(current_user, issuable, :incident_relate)
end
def link_class
IssueLink
end
end
end
IssueLinks::CreateService.prepend_mod_with('IssueLinks::CreateService')
|