Skip to content
Snippets Groups Projects
Commit 5d6af36f authored by Douwe Maan's avatar Douwe Maan
Browse files

Fix GitAccess.

parent 501e1215
No related branches found
No related tags found
1 merge request!635Improve text. All text.
Pipeline #
Loading
Loading
@@ -136,7 +136,7 @@ module Gitlab
end
 
unless user.can?(action, project)
return
status =
case action
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.")
Loading
Loading
@@ -148,7 +148,8 @@ module Gitlab
build_status_object(false, "You are not allowed to change existing tags on this project.")
else # :push_code
build_status_object(false, "You are not allowed to push code to this project.")
end
end
return status
end
 
build_status_object(true)
Loading
Loading
Loading
Loading
@@ -115,18 +115,10 @@ describe Gitlab::GitAccess do
let(:actor) { key }
 
context 'pull code' do
context 'allowed' do
before { key.projects << project }
subject { access.download_access_check }
it { expect(subject.allowed?).to be_truthy }
end
context 'denied' do
subject { access.download_access_check }
before { key.projects << project }
subject { access.download_access_check }
 
it { expect(subject.allowed?).to be_falsey }
end
it { expect(subject.allowed?).to be_truthy }
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment