summaryrefslogtreecommitdiff
path: root/app/services/issues/close_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/issues/close_service.rb')
-rw-r--r--app/services/issues/close_service.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/services/issues/close_service.rb b/app/services/issues/close_service.rb
index 4f6a859e20e..9fde1cc2ac2 100644
--- a/app/services/issues/close_service.rb
+++ b/app/services/issues/close_service.rb
@@ -2,6 +2,11 @@
module Issues
class CloseService < Issues::BaseService
+ # TODO: this is to be removed once we get to rename the IssuableBaseService project param to container
+ def initialize(container:, current_user: nil, params: {})
+ super(project: container, current_user: current_user, params: params)
+ end
+
# Closes the supplied issue if the current user is able to do so.
def execute(issue, commit: nil, notifications: true, system_note: true, skip_authorization: false)
return issue unless can_close?(issue, skip_authorization: skip_authorization)
@@ -51,6 +56,11 @@ module Issues
private
+ # TODO: remove once MergeRequests::CloseService or IssuableBaseService method is changed.
+ def self.constructor_container_arg(value)
+ { container: value }
+ end
+
def can_close?(issue, skip_authorization: false)
skip_authorization || can?(current_user, :update_issue, issue) || issue.is_a?(ExternalIssue)
end