diff options
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 2aaa0557ea3..bae7f35a77d 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -281,6 +281,12 @@ module API error!({ 'message' => message }, status) end + def require_feature!(feature) + unless Gitlab::Feature.feature_enabled?(feature) + render_api_error!('503 Service Unavailable', 503) + end + end + # Projects helpers def filter_projects(projects) |