summaryrefslogtreecommitdiff
path: root/lib/ci/api/helpers.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-19 00:15:49 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-19 00:15:49 +0200
commit442db0801aea1f11163e7e128da6cbcf2823c5cd (patch)
tree95f63e0438dcb3a157d72d4382662a22c73a5cb5 /lib/ci/api/helpers.rb
parent6776dcf90b9e101b8c9341ea83621e48f87584d6 (diff)
parent5a8d73243a7b68f2724a6d5f9d482dda24e9dfe4 (diff)
downloadgitlab-ce-442db0801aea1f11163e7e128da6cbcf2823c5cd.tar.gz
Merge branch 'master' into ci-build-list
Diffstat (limited to 'lib/ci/api/helpers.rb')
-rw-r--r--lib/ci/api/helpers.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ci/api/helpers.rb b/lib/ci/api/helpers.rb
index e602cda81d6..8e893aa5cc6 100644
--- a/lib/ci/api/helpers.rb
+++ b/lib/ci/api/helpers.rb
@@ -3,6 +3,12 @@ module Ci
module Helpers
UPDATE_RUNNER_EVERY = 60
+ def check_enable_flag!
+ unless current_application_settings.ci_enabled
+ render_api_error!('400 (Bad request) CI is disabled', 400)
+ end
+ end
+
def authenticate_runners!
forbidden! unless params[:token] == GitlabCi::REGISTRATION_TOKEN
end