BigW Consortium Gitlab

Commit 5da9bfa4 by Lin Jen-Shin

Fix test for GitAccessWiki, it's overriding change_access_check

parent 40632455
......@@ -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
......
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment