Commit e60f3b19 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '354603-fix-auditor-permissions-for-VSA' into 'master'

Allow auditor to view group VSA analytics

See merge request gitlab-org/gitlab!84058
parents ac59ecff eb0275d9
......@@ -176,6 +176,7 @@ module EE
enable :view_group_devops_adoption
enable :read_group_repository_analytics
enable :read_group_contribution_analytics
enable :read_group_cycle_analytics
end
rule { owner | admin }.policy do
......
......@@ -335,6 +335,40 @@ RSpec.describe GroupPolicy do
it { is_expected.not_to be_allowed(:read_group_repository_analytics) }
end
context 'when group cycle analytics is available' do
before do
stub_licensed_features(cycle_analytics_for_groups: true)
end
context 'for guests' do
let(:current_user) { guest }
it { is_expected.not_to be_allowed(:read_group_cycle_analytics) }
end
context 'for reporter+' do
let(:current_user) { reporter }
it { is_expected.to be_allowed(:read_group_cycle_analytics) }
end
context 'for auditor' do
let(:current_user) { auditor }
it { is_expected.to be_allowed(:read_group_cycle_analytics) }
end
end
context 'when group cycle analytics is not available' do
let(:current_user) { maintainer }
before do
stub_licensed_features(cycle_analytics_for_groups: false)
end
it { is_expected.not_to be_allowed(:read_group_cycle_analytics) }
end
context 'when group coverage reports is available' do
before do
stub_licensed_features(group_coverage_reports: true)
......
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