summaryrefslogtreecommitdiff
path: root/spec/features/security
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-10-13 09:38:03 +0200
committerZ.J. van de Weg <git@zjvandeweg.nl>2016-12-04 15:48:50 +0100
commit617f43c74b967a085f6cd7afb1408cfa28187b52 (patch)
treede6e860add1690c240806c5de4289bf2a633d3f7 /spec/features/security
parentbd67459131e22273b502eb27d97709827ff42262 (diff)
downloadgitlab-ce-617f43c74b967a085f6cd7afb1408cfa28187b52.tar.gz
Guests can read builds if those are public
Fixes #18448
Diffstat (limited to 'spec/features/security')
-rw-r--r--spec/features/security/project/private_access_spec.rb52
1 files changed, 52 insertions, 0 deletions
diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb
index 290ddb4c6dd..a942a1ace3b 100644
--- a/spec/features/security/project/private_access_spec.rb
+++ b/spec/features/security/project/private_access_spec.rb
@@ -260,6 +260,19 @@ describe "Private Project Access", feature: true do
it { is_expected.to be_denied_for(:user) }
it { is_expected.to be_denied_for(:external) }
it { is_expected.to be_denied_for(:visitor) }
+
+ context 'when public builds is enabled' do
+ it { is_expected.to be_allowed_for guest }
+ end
+
+ context 'when public buils are disabled' do
+ before do
+ project.public_builds = false
+ project.save
+ end
+
+ it { is_expected.to be_denied_for guest }
+ end
end
describe "GET /:project_path/pipelines/:id" do
@@ -275,6 +288,19 @@ describe "Private Project Access", feature: true do
it { is_expected.to be_denied_for(:user) }
it { is_expected.to be_denied_for(:external) }
it { is_expected.to be_denied_for(:visitor) }
+
+ context 'when public builds is enabled' do
+ it { is_expected.to be_allowed_for guest }
+ end
+
+ context 'when public buils are disabled' do
+ before do
+ project.public_builds = false
+ project.save
+ end
+
+ it { is_expected.to be_denied_for guest }
+ end
end
describe "GET /:project_path/builds" do
@@ -289,6 +315,19 @@ describe "Private Project Access", feature: true do
it { is_expected.to be_denied_for(:user) }
it { is_expected.to be_denied_for(:external) }
it { is_expected.to be_denied_for(:visitor) }
+
+ context 'when public builds is enabled' do
+ it { is_expected.to be_allowed_for guest }
+ end
+
+ context 'when public buils are disabled' do
+ before do
+ project.public_builds = false
+ project.save
+ end
+
+ it { is_expected.to be_denied_for guest }
+ end
end
describe "GET /:project_path/builds/:id" do
@@ -305,6 +344,19 @@ describe "Private Project Access", feature: true do
it { is_expected.to be_denied_for(:user) }
it { is_expected.to be_denied_for(:external) }
it { is_expected.to be_denied_for(:visitor) }
+
+ context 'when public builds is enabled' do
+ it { is_expected.to be_allowed_for guest }
+ end
+
+ context 'when public buils are disabled' do
+ before do
+ project.public_builds = false
+ project.save
+ end
+
+ it { is_expected.to be_denied_for guest }
+ end
end
describe "GET /:project_path/environments" do