diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-16 23:58:08 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-30 23:55:09 +0900 |
commit | a104e7a2c92d9752e48b2ac776b547809b0036d5 (patch) | |
tree | b74ade30f9441d673c865185d277250bbc062e53 | |
parent | 427eac90a3b6965009dd853d7246c248988974e8 (diff) | |
download | gitlab-ce-a104e7a2c92d9752e48b2ac776b547809b0036d5.tar.gz |
Move authenticate! to before
-rw-r--r-- | lib/api/pipeline_schedules.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/api/pipeline_schedules.rb b/lib/api/pipeline_schedules.rb index 81b88b17041..2319ff639e5 100644 --- a/lib/api/pipeline_schedules.rb +++ b/lib/api/pipeline_schedules.rb @@ -2,6 +2,8 @@ module API class PipelineSchedules < Grape::API include PaginationParams + before { authenticate! } + params do requires :id, type: String, desc: 'The ID of a project' end @@ -13,7 +15,6 @@ module API use :pagination end get ':id/pipeline_schedules' do - authenticate! authorize! :read_pipeline_schedule, user_project pipeline_schedules = user_project.pipeline_schedules @@ -28,7 +29,6 @@ module API requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id' end get ':id/pipeline_schedules/:pipeline_schedule_id' do - authenticate! authorize! :read_pipeline_schedule, user_project pipeline_schedule = user_project.pipeline_schedules.find(params.delete(:pipeline_schedule_id)) @@ -48,7 +48,6 @@ module API requires :active, type: Boolean, desc: 'The activation of pipeline schedule' end post ':id/pipeline_schedules' do - authenticate! authorize! :create_pipeline_schedule, user_project pipeline_schedule = Ci::CreatePipelineScheduleService @@ -74,7 +73,6 @@ module API optional :active, type: Boolean, desc: 'The activation of pipeline schedule' end put ':id/pipeline_schedules/:pipeline_schedule_id' do - authenticate! authorize! :create_pipeline_schedule, user_project pipeline_schedule = user_project.pipeline_schedules.find(params.delete(:pipeline_schedule_id)) @@ -94,7 +92,6 @@ module API requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id' end post ':id/pipeline_schedules/:pipeline_schedule_id/take_ownership' do - authenticate! authorize! :create_pipeline_schedule, user_project pipeline_schedule = user_project.pipeline_schedules.find(params.delete(:pipeline_schedule_id)) @@ -115,7 +112,6 @@ module API requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id' end delete ':id/pipeline_schedules/:pipeline_schedule_id' do - authenticate! authorize! :admin_pipeline_schedule, user_project pipeline_schedule = user_project.pipeline_schedules.find(params.delete(:pipeline_schedule_id)) |