Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-06-29 14:04:06 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-06-29 14:04:06 +0300
commit23a3ce946ad0f7ef1c63036bf313cd549d18f0ab (patch)
treec4e64fd652b9ed0289659fb673fa79206ae162de /app/controllers/projects/runner_projects_controller.rb
parentdeb5509f7bc3eec8fa47939144a52cda7d408625 (diff)
Use Ability to check pre-requisite. Change back to 403 because:
If we're using `can?` it would look weird to use 409
Diffstat (limited to 'app/controllers/projects/runner_projects_controller.rb')
-rw-r--r--app/controllers/projects/runner_projects_controller.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/controllers/projects/runner_projects_controller.rb b/app/controllers/projects/runner_projects_controller.rb
index dc825557928..8267b14941d 100644
--- a/app/controllers/projects/runner_projects_controller.rb
+++ b/app/controllers/projects/runner_projects_controller.rb
@@ -6,8 +6,7 @@ class Projects::RunnerProjectsController < Projects::ApplicationController
def create
@runner = Ci::Runner.find(params[:runner_project][:runner_id])
- return head(409) if @runner.is_shared? || @runner.locked?
- return head(409) unless current_user.ci_authorized_runners.include?(@runner)
+ return head(403) unless can?(current_user, :assign_runner, @runner)
path = runners_path(project)
runner_project = @runner.assign_to(project, current_user)