From 3457695b1e3d2c6e5a10cff6e24a08f7cbb38503 Mon Sep 17 00:00:00 2001 From: Sam Battalio Date: Mon, 24 Jun 2019 22:12:42 +0000 Subject: Change HTTP Status Code when repository disabled --- lib/api/helpers.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/api/helpers.rb') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 6382d295f79..8ae42c6dadd 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -250,6 +250,10 @@ module API authorize! :update_build, user_project end + def require_repository_enabled!(subject = :global) + not_found!("Repository") unless user_project.feature_available?(:repository, current_user) + end + def require_gitlab_workhorse! unless env['HTTP_GITLAB_WORKHORSE'].present? forbidden!('Request should be executed via GitLab Workhorse') -- cgit v1.2.1