summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2024-05-11 08:35:27 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2024-05-11 08:35:27 +0000
commit47099ccd3a6aa54c59541f87e98a88358021be2a (patch)
treec330c337e7a73e50b7d8f890feb3792e40f20d53 /app/models
parent6d89e6a9ed6c2b62e84cacf3fabc856bb71da154 (diff)
downloadredmine-47099ccd3a6aa54c59541f87e98a88358021be2a.tar.gz
redmine-47099ccd3a6aa54c59541f87e98a88358021be2a.zip
Fixes issue list filter "Watched by: me" only shows issues watched via group for projects with the @view_issue_watchers@ permission (#40412).
git-svn-id: https://svn.redmine.org/redmine/trunk@22819 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/issue_query.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index 0895e8074..687a8bdba 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -551,7 +551,9 @@ class IssueQuery < Query
def sql_for_watcher_id_field(field, operator, value)
db_table = Watcher.table_name
- me, others = value.partition {|id| ['0', User.current.id.to_s].include?(id)}
+ me_ids = [0, User.current.id]
+ me_ids = me_ids.concat(User.current.groups.pluck(:id))
+ me, others = value.partition {|id| me_ids.include?(id.to_i)}
sql =
if others.any?
"SELECT #{Issue.table_name}.id FROM #{Issue.table_name} " +