Merge pull request #5144 from opf/fix/24534/watched-filter

[24534] Fix query for watched work packages as non-admin
pull/5147/head
Markus Kahl 8 years ago committed by GitHub
commit 65a8289e4d
  1. 2
      app/models/query.rb

@ -449,7 +449,7 @@ class Query < ActiveRecord::Base
WHERE #{db_table}.watchable_type='WorkPackage'
AND #{sql_for_field field, '=', values, db_table, db_field})
AND #{Project.table_name}.id IN
(#{Project.allowed_to(User.current, :view_work_package_watchers).to_sql})
(#{Project.allowed_to(User.current, :view_work_package_watchers).select("#{Project.table_name}.id").to_sql})
SQL
sql << "(#{sql_parts.join(' OR ')})"
end

Loading…
Cancel
Save