summaryrefslogtreecommitdiff
path: root/app/policies/ci
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-05-09 16:41:15 +0200
committerDylan Griffith <dyl.griffith@gmail.com>2018-05-16 10:52:28 +0200
commit7320684c00ada153c0a9b102f8cf2db38367129a (patch)
tree919384d543fa667fa7ee29c368d8c5e043c34426 /app/policies/ci
parent846f73b53b8a6d3bc1f18607630d7a7853cb9d13 (diff)
downloadgitlab-ce-7320684c00ada153c0a9b102f8cf2db38367129a.tar.gz
Use can? policies for lib/api/runners.rb
Diffstat (limited to 'app/policies/ci')
-rw-r--r--app/policies/ci/runner_policy.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/policies/ci/runner_policy.rb b/app/policies/ci/runner_policy.rb
index 7dff8470e23..2908989b154 100644
--- a/app/policies/ci/runner_policy.rb
+++ b/app/policies/ci/runner_policy.rb
@@ -1,16 +1,16 @@
module Ci
class RunnerPolicy < BasePolicy
with_options scope: :subject, score: 0
- condition(:shared) { @subject.is_shared? }
-
- with_options scope: :subject, score: 0
condition(:locked, scope: :subject) { @subject.locked? }
condition(:authorized_runner) { @user.ci_authorized_runners.include?(@subject) }
rule { anonymous }.prevent_all
rule { admin | authorized_runner }.enable :assign_runner
- rule { ~admin & shared }.prevent :assign_runner
+ rule { admin | authorized_runner }.enable :read_runner
+ rule { admin | authorized_runner }.enable :update_runner
+ rule { admin | authorized_runner }.enable :delete_runner
+ rule { admin | authorized_runner }.enable :list_runner_jobs
rule { ~admin & locked }.prevent :assign_runner
end
end