Commit f549b01a authored by Nick Thomas's avatar Nick Thomas

Fix conflicts in Gitlab::GitAccessWiki and specs

parent ab65d03b
module Gitlab
class GitAccessWiki < GitAccess
ERROR_MESSAGES = {
geo: "You can't push code to a secondary GitLab Geo node.",
write_to_wiki: "You are not allowed to write to this project's wiki."
}.freeze
......@@ -13,17 +14,12 @@ module Gitlab
end
def check_single_change_access(change)
<<<<<<< HEAD
if Gitlab::Geo.enabled? && Gitlab::Geo.secondary?
build_status_object(false, "You can't push code to a secondary GitLab Geo node.")
elsif user_access.can_do_action?(:create_wiki)
build_status_object(true)
else
build_status_object(false, "You are not allowed to write to this project's wiki.")
=======
raise UnauthorizedError, ERROR_MESSAGES[:geo]
end
unless user_access.can_do_action?(:create_wiki)
raise UnauthorizedError, ERROR_MESSAGES[:write_to_wiki]
>>>>>>> ce/master
end
true
......
......@@ -22,20 +22,15 @@ describe Gitlab::GitAccessWiki, lib: true do
subject { access.check('git-receive-pack', changes) }
<<<<<<< HEAD
it { expect(subject.allowed?).to be_truthy }
it { expect { subject }.not_to raise_error }
context 'when in a secondary gitlab geo node' do
before do
allow(Gitlab::Geo).to receive(:enabled?) { true }
allow(Gitlab::Geo).to receive(:secondary?) { true }
end
=======
it { expect { subject }.not_to raise_error }
end
>>>>>>> ce/master
it { expect(subject.allowed?).to be_falsey }
it { expect { subject }.to raise_error(Gitlab::GitAccess::UnauthorizedError, "You can't push code to a secondary GitLab Geo node.") }
end
end
end
......
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