diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-03-31 18:20:19 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-04-07 17:27:48 +0300 |
commit | 225972f14a8b9433a82cdb20b3ab9814503f8338 (patch) | |
tree | 6c99927dfa9c54179af1ce23ebcb6cd28710877d /app/controllers | |
parent | 5b9184dbf422085052ea7073b375ca2a944e546f (diff) | |
download | gitlab-ci-developers_can_cancel_job.tar.gz |
developers can cancel and retry jobdevelopers_can_cancel_job
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/builds_controller.rb | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0c8180e..c412a45 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -48,6 +48,12 @@ class ApplicationController < ActionController::Base end end + def authorize_project_developer! + unless current_user.has_developer_access?(@project.gitlab_id) + return page_404 + end + end + def authorize_manage_project! unless current_user.can_manage_project?(@project.gitlab_id) return page_404 diff --git a/app/controllers/builds_controller.rb b/app/controllers/builds_controller.rb index bb485c0..a1cb017 100644 --- a/app/controllers/builds_controller.rb +++ b/app/controllers/builds_controller.rb @@ -2,7 +2,8 @@ class BuildsController < ApplicationController before_filter :authenticate_user!, except: [:status] before_filter :project before_filter :authorize_access_project!, except: [:status] - before_filter :authorize_manage_project!, except: [:status, :show] + before_filter :authorize_manage_project!, except: [:status, :show, :retry, :cancel] + before_filter :authorize_project_developer!, only: [:retry, :cancel] before_filter :build, except: [:show] def show |