Merge branch 'security_bug_fix_close_issue' into 'master'
[Security] Automatic issue closing Fixes https://dev.gitlab.org/gitlab/gitlabhq/issues/2640 See merge request !1944
This commit is contained in:
commit
5a07032d26
2 changed files with 6 additions and 2 deletions
|
@ -96,7 +96,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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue