diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-08-18 09:52:35 -0700 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-08-30 11:39:22 -0700 |
commit | 5019185edd7718b262eb5ae94f21763f230f0557 (patch) | |
tree | 87fe3b1d6ed440dc4d0ef09138010e801cdaac5a /app/policies/ci | |
parent | 29059c2e9c7be418d2a99a136934c6d9cca5fccd (diff) | |
download | gitlab-ce-5019185edd7718b262eb5ae94f21763f230f0557.tar.gz |
port runners, namespaces, group/project_members
Diffstat (limited to 'app/policies/ci')
-rw-r--r-- | app/policies/ci/runner_policy.rb | 13 |
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 |