diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-23 11:41:22 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-23 11:45:45 +0200 |
commit | 3adfee1c8724d56e051da21e18d83435e8b6ba31 (patch) | |
tree | 7a6a8cfaf71679269a1c06dd7e64e706101cfa5e /app/controllers/projects/commit_controller.rb | |
parent | 127836dd541ce0ecd4976d002d97b3e9e57f4947 (diff) | |
download | gitlab-ce-3adfee1c8724d56e051da21e18d83435e8b6ba31.tar.gz |
Allow developer to manage builds
Diffstat (limited to 'app/controllers/projects/commit_controller.rb')
-rw-r--r-- | app/controllers/projects/commit_controller.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 7886f3c6deb..878c3a66e7d 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -4,7 +4,8 @@ class Projects::CommitController < Projects::ApplicationController # Authorize before_action :require_non_empty_project - before_action :authorize_download_code! + before_action :authorize_download_code!, except: [:cancel_builds] + before_action :authorize_manage_builds!, only: [:cancel_builds] before_action :commit def show @@ -55,4 +56,12 @@ class Projects::CommitController < Projects::ApplicationController def commit @commit ||= @project.commit(params[:id]) end + + private + + def authorize_manage_builds! + unless can?(current_user, :manage_builds, project) + return page_404 + end + end end |