Project

General

Profile

Actions

Defect #12286

closed

Emails of private notes are sent to watcher users regardless of viewing permissions

Added by Ricardo S over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Email notifications
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Mailer for both for issue_add and issue_edit doesn't take watchers' private notes viewing permissions in consideration when generating the cc list.

A possible solution would be to do the following:

  recipients = journal.recipients
  watchers = journal.journalized.watcher_users.active
  watchers.reject! {|user| !journal.visible?(user)}

  cc = watchers.collect(&:mail) - recipients

Being journal.visible? a new method on Journal:

  def visible?(usr=User.current)
    issue.visible?(usr) && (!private_notes? || usr.allowed_to?(:view_private_notes, project))
  end


Related issues

Related to Redmine - Feature #1554: Private comments in ticketsClosedJean-Philippe Lang2008-06-30

Actions
Actions

Also available in: Atom PDF