Skip to content
Snippets Groups Projects
Commit 063c68b1 authored by Douwe Maan's avatar Douwe Maan
Browse files

Proper authorization for cancel/retry builds.

parent 19ef7528
No related branches found
No related tags found
No related merge requests found
class Projects::BuildsController < Projects::ApplicationController
before_action :ci_project
before_action :build, except: [:index, :cancel_all]
before_action :authorize_admin_project!, except: [:index, :show, :status]
before_action :authorize_manage_builds!, except: [:index, :show, :status]
 
layout "project"
 
Loading
Loading
@@ -73,4 +72,10 @@ class Projects::BuildsController < Projects::ApplicationController
def build_path(build)
namespace_project_build_path(build.gl_project.namespace, build.gl_project, build)
end
def authorize_manage_builds!
unless can?(current_user, :manage_builds, project)
return page_404
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment