Commit 18821b15 authored by Dylan Griffith's avatar Dylan Griffith

Improve efficiency of authorized_runner policy query

parent 7320684c
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment