Commit 12699360 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'pl-base-policy-anonymous-read-cross-project' into 'master'

Add policy read_cross_project specs for anonymous

See merge request gitlab-org/gitlab!29198
parents d694da34 cce8955b
...@@ -30,6 +30,12 @@ describe BasePolicy, :do_not_mock_admin_mode do ...@@ -30,6 +30,12 @@ describe BasePolicy, :do_not_mock_admin_mode do
it { is_expected.to be_allowed(:read_cross_project) } it { is_expected.to be_allowed(:read_cross_project) }
context 'for anonymous' do
let(:current_user) { nil }
it { is_expected.to be_allowed(:read_cross_project) }
end
context 'when an external authorization service is enabled' do context 'when an external authorization service is enabled' do
before do before do
enable_external_authorization_service_check enable_external_authorization_service_check
...@@ -52,6 +58,12 @@ describe BasePolicy, :do_not_mock_admin_mode do ...@@ -52,6 +58,12 @@ describe BasePolicy, :do_not_mock_admin_mode do
is_expected.not_to be_allowed(:read_cross_project) is_expected.not_to be_allowed(:read_cross_project)
end end
end end
context 'for anonymous' do
let(:current_user) { nil }
it { is_expected.not_to be_allowed(:read_cross_project) }
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