summaryrefslogtreecommitdiff
path: root/lib/api/v3
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-08-26 04:04:57 +0900
committerShinya Maeda <shinya@gitlab.com>2017-09-04 21:55:26 +0900
commitacc7497855167d4f6ba481422112645a1a04a885 (patch)
treed88d455aae397df882451be48bc776ec7a4ba28a /lib/api/v3
parent75130a41ba19b80ac7b2300721915787ac4681bf (diff)
downloadgitlab-ce-acc7497855167d4f6ba481422112645a1a04a885.tar.gz
Revert autheticate! in Trigger API
Diffstat (limited to 'lib/api/v3')
-rw-r--r--lib/api/v3/triggers.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/v3/triggers.rb b/lib/api/v3/triggers.rb
index ffc1a38acbc..e1da96104a5 100644
--- a/lib/api/v3/triggers.rb
+++ b/lib/api/v3/triggers.rb
@@ -16,16 +16,16 @@ module API
optional :variables, type: Hash, desc: 'The list of variables to be injected into build'
end
post ":id/(ref/:ref/)trigger/builds", requirements: { ref: /.+/ } do
- authenticate!
- authorize! :admin_build, user_project
-
# validate variables
params[:variables] = params[:variables].to_h
unless params[:variables].all? { |key, value| key.is_a?(String) && value.is_a?(String) }
render_api_error!('variables needs to be a map of key-valued strings', 400)
end
- result = Ci::PipelineTriggerService.new(user_project, nil, params).execute
+ project = find_project(params[:id])
+ not_found! unless project
+
+ result = Ci::PipelineTriggerService.new(project, nil, params).execute
not_found! unless result
if result[:http_status]