Commit 48298a0b authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'fix-wrong-productivity-analytics-response-code' into 'master'

Use 403 when PA licensed feature is not available

See merge request gitlab-org/gitlab!16594
parents f59728a2 7666d911
...@@ -52,8 +52,8 @@ class Analytics::ProductivityAnalyticsController < Analytics::ApplicationControl ...@@ -52,8 +52,8 @@ class Analytics::ProductivityAnalyticsController < Analytics::ApplicationControl
end end
def check_feature_availability! def check_feature_availability!
return render_404 unless ::License.feature_available?(:productivity_analytics) return render_403 unless ::License.feature_available?(:productivity_analytics)
return render_404 if @group && !@group.root_ancestor.feature_available?(:productivity_analytics) return render_403 if @group && !@group.root_ancestor.feature_available?(:productivity_analytics)
end end
def load_group def load_group
......
...@@ -43,7 +43,7 @@ describe Analytics::ProductivityAnalyticsController do ...@@ -43,7 +43,7 @@ describe Analytics::ProductivityAnalyticsController do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(403)
end end
it 'authorizes for ability to view analytics' do it 'authorizes for ability to view analytics' 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