Commit 7f7f9c58 authored by Aakriti Gupta's avatar Aakriti Gupta Committed by Dmytro Zaporozhets

Change group policy for Group Activity Analytics

Only allow users who have access to the group, to
be able to access the analytics
parent 999ba82d
......@@ -87,7 +87,7 @@ module EE
rule { has_access & contribution_analytics_available }
.enable :read_group_contribution_analytics
rule { can?(:read_group) & group_activity_analytics_available }
rule { has_access & group_activity_analytics_available }
.enable :read_group_activity_analytics
rule { reporter & cycle_analytics_available }.policy do
......
......@@ -10,6 +10,7 @@ describe 'GroupAnalytics' do
before do
stub_licensed_features(group_activity_analytics: true)
group.add_developer(user)
sign_in(user)
end
......
......@@ -48,7 +48,7 @@ describe API::Analytics::GroupActivityAnalytics do
end
end
context 'when user has no authorization to view a private group' do
context 'when user does not have access to a group' do
let(:current_user) { anonymous_user }
it 'is returns `not_found`' 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