summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-09 10:13:09 +0100
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-09 10:13:09 +0100
commit0f149803832df053ee94a448f741d208d75c157f (patch)
tree48cd8527c2f65e4221eb45316747fb17729ae74d /app
parentc674ffe0e045e46fd0f2754b77b1042444d95388 (diff)
parent5a07032d265b97bfbbfe9e8bfd8079a6470b10e6 (diff)
downloadgitlab-ce-0f149803832df053ee94a448f741d208d75c157f.tar.gz
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq
Diffstat (limited to 'app')
-rw-r--r--app/services/git_push_service.rb4
-rw-r--r--app/services/merge_requests/post_merge_service.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index 736b82e3571..93a16e88967 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -110,7 +110,9 @@ class GitPushService < BaseService
# a different branch.
closed_issues = commit.closes_issues(current_user)
closed_issues.each do |issue|
- Issues::CloseService.new(project, authors[commit], {}).execute(issue, commit)
+ if can?(current_user, :update_issue, issue)
+ Issues::CloseService.new(project, authors[commit], {}).execute(issue, commit)
+ end
end
end
diff --git a/app/services/merge_requests/post_merge_service.rb b/app/services/merge_requests/post_merge_service.rb
index 8f25c5e2496..ebb67c7db65 100644
--- a/app/services/merge_requests/post_merge_service.rb
+++ b/app/services/merge_requests/post_merge_service.rb
@@ -21,7 +21,9 @@ module MergeRequests
closed_issues = merge_request.closes_issues(current_user)
closed_issues.each do |issue|
- Issues::CloseService.new(project, current_user, {}).execute(issue, merge_request)
+ if can?(current_user, :update_issue, issue)
+ Issues::CloseService.new(project, current_user, {}).execute(issue, merge_request)
+ end
end
end