diff options
Diffstat (limited to 'app/services/issues/reopen_service.rb')
-rw-r--r-- | app/services/issues/reopen_service.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/services/issues/reopen_service.rb b/app/services/issues/reopen_service.rb index 977b924ed72..4abd1dfbf4e 100644 --- a/app/services/issues/reopen_service.rb +++ b/app/services/issues/reopen_service.rb @@ -2,10 +2,10 @@ module Issues class ReopenService < Issues::BaseService - def execute(issue) - return issue unless can?(current_user, :reopen_issue, issue) + def execute(issue, skip_authorization: false) + return issue unless can_reopen?(issue, skip_authorization: skip_authorization) - if issue.reopen + if perform_reopen(issue) event_service.reopen_issue(issue, current_user) create_note(issue, 'reopened') notification_service.async.reopen_issue(issue, current_user) @@ -22,6 +22,15 @@ module Issues private + # Overriden on EE + def perform_reopen(issue) + issue.reopen + end + + def can_reopen?(issue, skip_authorization: false) + skip_authorization || can?(current_user, :reopen_issue, issue) + end + def perform_incident_management_actions(issue) end |