Improve efficiency of authorized_runner policy query
This commit is contained in:
parent
7320684c00
commit
18821b157d
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue