summaryrefslogtreecommitdiff
path: root/lib/gitlab/git_access.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-11-11 22:26:05 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-11-11 22:26:05 +0800
commit5da9bfa453268474b3bff13c63e55b29bbcdf016 (patch)
treead716ddfe4ce801f563fc32786658988e36b2aac /lib/gitlab/git_access.rb
parent40632455b83e78ec30af2eb93ced02afc5c4d4a0 (diff)
downloadgitlab-ce-5da9bfa453268474b3bff13c63e55b29bbcdf016.tar.gz
Fix test for GitAccessWiki, it's overriding change_access_check
Diffstat (limited to 'lib/gitlab/git_access.rb')
-rw-r--r--lib/gitlab/git_access.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index 96979398c83..b462cffeaf6 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -138,9 +138,7 @@ module Gitlab
# Iterate over all changes to find if user allowed all of them to be applied
changes_list.each do |change|
- status = Checks::ChangeAccess.new(change,
- user_access: user_access,
- project: project).exec
+ status = check_single_change_access(change)
unless status.allowed?
# If user does not have access to make at least one change - cancel all push
raise UnauthorizedError, status.message
@@ -148,6 +146,11 @@ module Gitlab
end
end
+ def check_single_change_access(change)
+ Checks::ChangeAccess.new(
+ change, user_access: user_access, project: project).exec
+ end
+
def matching_merge_request?(newrev, branch_name)
Checks::MatchingMergeRequest.new(newrev, branch_name, project).match?
end