Fixed that watchers receive notifications for private comments without permission (#12286).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10789 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-11-05 15:49:07 +00:00
parent 7f3cc6e38b
commit c8b722456c
4 changed files with 32 additions and 6 deletions
+8
View File
@@ -100,6 +100,14 @@ class Journal < ActiveRecord::Base
notified.map(&:mail)
end
def watcher_recipients
notified = journalized.notified_watchers
if private_notes?
notified = notified.select {|user| user.allowed_to?(:view_private_notes, journalized.project)}
end
notified.map(&:mail)
end
private
def split_private_notes
+1 -1
View File
@@ -64,7 +64,7 @@ class Mailer < ActionMailer::Base
@author = journal.user
recipients = journal.recipients
# Watchers in cc
cc = issue.watcher_recipients - recipients
cc = journal.watcher_recipients - recipients
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject