diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-11 22:26:05 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-11 22:26:05 +0800 |
commit | 5da9bfa453268474b3bff13c63e55b29bbcdf016 (patch) | |
tree | ad716ddfe4ce801f563fc32786658988e36b2aac | |
parent | 40632455b83e78ec30af2eb93ced02afc5c4d4a0 (diff) | |
download | gitlab-ce-5da9bfa453268474b3bff13c63e55b29bbcdf016.tar.gz |
Fix test for GitAccessWiki, it's overriding change_access_check
-rw-r--r-- | lib/gitlab/git_access.rb | 9 | ||||
-rw-r--r-- | lib/gitlab/git_access_wiki.rb | 2 |
2 files changed, 7 insertions, 4 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 diff --git a/lib/gitlab/git_access_wiki.rb b/lib/gitlab/git_access_wiki.rb index f71d3575909..f7976a64ef5 100644 --- a/lib/gitlab/git_access_wiki.rb +++ b/lib/gitlab/git_access_wiki.rb @@ -1,6 +1,6 @@ module Gitlab class GitAccessWiki < GitAccess - def change_access_check(change) + def check_single_change_access(change) if user_access.can_do_action?(:create_wiki) build_status_object(true) else |