diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-13 14:26:54 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-13 14:26:54 +0000 |
commit | bb477a3a0fe71f0e15b78b6e0fafb017065fba26 (patch) | |
tree | 5fe5daa3d87fa80c93b0e77bc95552079a1389c5 /app/models/message.rb | |
parent | 6610bb6b6cbb1ef72787542063359de04fbab6be (diff) | |
download | redmine-bb477a3a0fe71f0e15b78b6e0fafb017065fba26.tar.gz redmine-bb477a3a0fe71f0e15b78b6e0fafb017065fba26.zip |
Make sure users don't get notified for thing they can not view (#3589).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3169 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/message.rb')
-rw-r--r-- | app/models/message.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/message.rb b/app/models/message.rb index 1e59719dd..535143775 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -90,6 +90,13 @@ class Message < ActiveRecord::Base usr && usr.logged? && (usr.allowed_to?(:delete_messages, project) || (self.author == usr && usr.allowed_to?(:delete_own_messages, project))) end + # Returns the mail adresses of users that should be notified + def recipients + notified = project.notified_users + notified.reject! {|user| !visible?(user)} + notified.collect(&:mail) + end + private def add_author_as_watcher |