Commit d9059c48 authored by Jason Goodman's avatar Jason Goodman Committed by Mayra Cabrera

Reject anonymous users for read_operations_dashboard

Adjust global policy
parent d1472cf0
...@@ -13,7 +13,7 @@ module EE ...@@ -13,7 +13,7 @@ module EE
License.feature_available?(:security_dashboard) License.feature_available?(:security_dashboard)
end end
rule { operations_dashboard_available }.enable :read_operations_dashboard rule { ~anonymous & operations_dashboard_available }.enable :read_operations_dashboard
rule { ~anonymous & security_dashboard_available }.enable :read_security_dashboard rule { ~anonymous & security_dashboard_available }.enable :read_security_dashboard
rule { admin }.policy do rule { admin }.policy do
......
...@@ -11,11 +11,19 @@ describe GlobalPolicy do ...@@ -11,11 +11,19 @@ describe GlobalPolicy do
subject { described_class.new(current_user, [user]) } subject { described_class.new(current_user, [user]) }
describe 'reading operations dashboard' do describe 'reading operations dashboard' do
before do context 'when licensed' do
stub_licensed_features(operations_dashboard: true) before do
end stub_licensed_features(operations_dashboard: true)
end
it { is_expected.to be_allowed(:read_operations_dashboard) } it { is_expected.to be_allowed(:read_operations_dashboard) }
context 'and the user is not logged in' do
let(:current_user) { nil }
it { is_expected.not_to be_allowed(:read_operations_dashboard) }
end
end
context 'when unlicensed' do context 'when unlicensed' do
before do before do
......
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