Commit 7666d911 authored by Adam Hegyi's avatar Adam Hegyi Committed by Peter Leitzen

Use 403 when PA licensed feature is not available

The frontend code expects the 403 HTTP response code to be returned
in order display message about the missing license or missing user
permission on the productivity analytics page.
parent f59728a2
......@@ -52,8 +52,8 @@ class Analytics::ProductivityAnalyticsController < Analytics::ApplicationControl
end
def check_feature_availability!
return render_404 unless ::License.feature_available?(:productivity_analytics)
return render_404 if @group && !@group.root_ancestor.feature_available?(:productivity_analytics)
return render_403 unless ::License.feature_available?(:productivity_analytics)
return render_403 if @group && !@group.root_ancestor.feature_available?(:productivity_analytics)
end
def load_group
......
......@@ -43,7 +43,7 @@ describe Analytics::ProductivityAnalyticsController do
subject
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(403)
end
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