diff options
-rw-r--r-- | app/models/user.rb | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 01ca1446376..25441d2b68f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -997,7 +997,7 @@ class User < ActiveRecord::Base def ci_authorized_runners @ci_authorized_runners ||= begin runner_ids = Ci::RunnerProject - .where("ci_runner_projects.project_id IN (#{ci_projects_union.to_sql})") # rubocop:disable GitlabSecurity/SqlInjection + .where(project: authorized_projects(Gitlab::Access::MASTER)) .select(:runner_id) Ci::Runner.specific.where(id: runner_ids) end @@ -1208,18 +1208,6 @@ class User < ActiveRecord::Base ], remove_duplicates: false) end - def ci_projects_union - manageable_other_projects = projects.where(members: { - access_level: [Gitlab::Access::MASTER, Gitlab::Access::OWNER] - }) - - Gitlab::SQL::Union.new([ - manageable_group_projects.select(:id), - personal_projects.select(:id), - manageable_other_projects.select(:id) - ]) - end - # Added according to https://github.com/plataformatec/devise/blob/7df57d5081f9884849ca15e4fde179ef164a575f/README.md#activejob-integration def send_devise_notification(notification, *args) return true unless can?(:receive_notifications) |