Commit 72104c3b authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'change-dashboard-policy' into 'master'

Update Global Policy to Reject Anonymous Users For read_operations_dashboard

See merge request gitlab-org/gitlab!18687
parents d1472cf0 d9059c48
......@@ -13,7 +13,7 @@ module EE
License.feature_available?(:security_dashboard)
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 { admin }.policy do
......
......@@ -11,11 +11,19 @@ describe GlobalPolicy do
subject { described_class.new(current_user, [user]) }
describe 'reading operations dashboard' do
before do
stub_licensed_features(operations_dashboard: true)
end
context 'when licensed' do
before do
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
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