summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-06-09 17:17:01 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2016-06-10 13:19:43 +0200
commitbeed70c0248fea13bdf727e5f14dee362b0cd298 (patch)
tree06a8fca1cf4dfcbd60b3dedfd96dda4adf778943 /lib/api/helpers.rb
parentd74a8900e27a98f1c921052d2fc44f38cc63a2ea (diff)
downloadgitlab-ce-beed70c0248fea13bdf727e5f14dee362b0cd298.tar.gz
Use feature flags for notes and award emojisfeature-flags
This allows us to disable creating/updating/removing of notes as well as toggling of award emojis.
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb6
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)