summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-05-11 10:56:02 +0200
committerDylan Griffith <dyl.griffith@gmail.com>2018-05-16 10:52:28 +0200
commit983bc6b175ab47fafefe2866dd19c3fdb98c2b84 (patch)
tree7e8735167362992a453fe98666d76222f23eefc8
parentb35d16a77f6a63db756a94eeff3788e819e7ed04 (diff)
downloadgitlab-ce-983bc6b175ab47fafefe2866dd19c3fdb98c2b84.tar.gz
Remove unnecessary runner.is_shared? checks in api because they are handled by policy
-rw-r--r--lib/api/runners.rb2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/api/runners.rb b/lib/api/runners.rb
index 0fb125a6944..5cb96d467c0 100644
--- a/lib/api/runners.rb
+++ b/lib/api/runners.rb
@@ -190,14 +190,12 @@ module API
def authenticate_update_runner!(runner)
return if current_user.admin?
- forbidden!("Runner is shared") if runner.is_shared?
forbidden!("No access granted") unless can?(current_user, :update_runner, runner)
end
def authenticate_delete_runner!(runner)
return if current_user.admin?
- forbidden!("Runner is shared") if runner.is_shared?
forbidden!("Runner associated with more than one project") if runner.projects.count > 1
forbidden!("No access granted") unless can?(current_user, :delete_runner, runner)
end