summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-05-22 09:14:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-05-22 09:14:36 +0000
commit7e1f04bdfb6fd8860a3a5b552b5983be9d1f1b1f (patch)
tree6733a009c5c85dc7b766b99fc6e805e366e4d4de /vendor
parent5543ec5f5a4f55529c55f296fda69a09c30670ae (diff)
downloadredmine-7e1f04bdfb6fd8860a3a5b552b5983be9d1f1b1f.tar.gz
redmine-7e1f04bdfb6fd8860a3a5b552b5983be9d1f1b1f.zip
Do not propose users that can't view an issue as watchers (#7412).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5876 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor')
-rw-r--r--vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb
index 61196d9a8..a22098eec 100644
--- a/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb
+++ b/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb
@@ -31,7 +31,11 @@ module Redmine
# Returns an array of users that are proposed as watchers
def addable_watcher_users
- self.project.users.sort - self.watcher_users
+ users = self.project.users.sort - self.watcher_users
+ if respond_to?(:visible?)
+ users.reject! {|user| !visible?(user)}
+ end
+ users
end
# Adds user as a watcher