summaryrefslogtreecommitdiff
path: root/app/policies/ci
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-08-18 09:52:35 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2016-08-30 11:39:22 -0700
commit5019185edd7718b262eb5ae94f21763f230f0557 (patch)
tree87fe3b1d6ed440dc4d0ef09138010e801cdaac5a /app/policies/ci
parent29059c2e9c7be418d2a99a136934c6d9cca5fccd (diff)
downloadgitlab-ce-5019185edd7718b262eb5ae94f21763f230f0557.tar.gz
port runners, namespaces, group/project_members
Diffstat (limited to 'app/policies/ci')
-rw-r--r--app/policies/ci/runner_policy.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/policies/ci/runner_policy.rb b/app/policies/ci/runner_policy.rb
new file mode 100644
index 00000000000..7edd383530d
--- /dev/null
+++ b/app/policies/ci/runner_policy.rb
@@ -0,0 +1,13 @@
+module Ci
+ class RunnerPolicy < BasePolicy
+ def rules
+ return unless @user
+
+ can! :assign_runner if @user.is_admin?
+
+ return if @subject.is_shared? || @subject.locked?
+
+ can! :assign_runner if @user.ci_authorized_runners.include?(@subject)
+ end
+ end
+end