diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-09 17:59:59 +0300 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-16 11:52:28 +0300 |
commit | 18821b157dbf3a73637ab741e8154b5133ce0e72 (patch) | |
tree | 63cfb67cbeff4ea96e528543d9112371ba94fdb9 /app/policies | |
parent | 7320684c00ada153c0a9b102f8cf2db38367129a (diff) |
Improve efficiency of authorized_runner policy query
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/ci/runner_policy.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/policies/ci/runner_policy.rb b/app/policies/ci/runner_policy.rb index 2908989b154..82d8e86ae05 100644 --- a/app/policies/ci/runner_policy.rb +++ b/app/policies/ci/runner_policy.rb @@ -3,7 +3,7 @@ module Ci with_options scope: :subject, score: 0 condition(:locked, scope: :subject) { @subject.locked? } - condition(:authorized_runner) { @user.ci_authorized_runners.include?(@subject) } + condition(:authorized_runner) { @user.ci_authorized_runners.exists?(@subject.id) } rule { anonymous }.prevent_all rule { admin | authorized_runner }.enable :assign_runner |