mirror of
https://github.com/redmine/redmine.git
synced 2026-05-06 08:16:05 +02:00
Introduces @valid_watcher?@ check on watchables (@40946).
Patch by Jens Krämer (@jkraemer). git-svn-id: https://svn.redmine.org/redmine/trunk@22916 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -70,6 +70,14 @@ module Redmine
|
||||
end
|
||||
end
|
||||
|
||||
# true if user can be added as a watcher
|
||||
def valid_watcher?(user)
|
||||
return true unless respond_to?(:visible?)
|
||||
return true unless user.is_a?(User)
|
||||
|
||||
visible?(user)
|
||||
end
|
||||
|
||||
# Adds user as a watcher
|
||||
def add_watcher(user)
|
||||
if persisted?
|
||||
|
||||
Reference in New Issue
Block a user