Commit c5e4b443 authored by Douwe Maan's avatar Douwe Maan

Fix GitAccess.

parent 1981174a
...@@ -136,7 +136,7 @@ module Gitlab ...@@ -136,7 +136,7 @@ module Gitlab
end end
unless user.can?(action, project) unless user.can?(action, project)
return status =
case action case action
when :force_push_code_to_protected_branches when :force_push_code_to_protected_branches
build_status_object(false, "You are not allowed to force push code to a protected branch on this project.") build_status_object(false, "You are not allowed to force push code to a protected branch on this project.")
...@@ -149,6 +149,7 @@ module Gitlab ...@@ -149,6 +149,7 @@ module Gitlab
else # :push_code else # :push_code
build_status_object(false, "You are not allowed to push code to this project.") build_status_object(false, "You are not allowed to push code to this project.")
end end
return status
end end
build_status_object(true) build_status_object(true)
......
...@@ -115,19 +115,11 @@ describe Gitlab::GitAccess do ...@@ -115,19 +115,11 @@ describe Gitlab::GitAccess do
let(:actor) { key } let(:actor) { key }
context 'pull code' do context 'pull code' do
context 'allowed' do
before { key.projects << project } before { key.projects << project }
subject { access.download_access_check } subject { access.download_access_check }
it { expect(subject.allowed?).to be_truthy } it { expect(subject.allowed?).to be_truthy }
end end
context 'denied' do
subject { access.download_access_check }
it { expect(subject.allowed?).to be_falsey }
end
end
end 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