diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-01-22 20:05:53 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-01-22 20:05:53 +0000 |
commit | 7dca1a180b11a5a47a63d39db1ed513b5c316270 (patch) | |
tree | e0378063c8828c3aee35da7cc8c1ff485e475f4e | |
parent | 91da86a688c27d13c373861901efffc2ec1ddbf1 (diff) | |
download | redmine-7dca1a180b11a5a47a63d39db1ed513b5c316270.tar.gz redmine-7dca1a180b11a5a47a63d39db1ed513b5c316270.zip |
Don't check permission to add watchers if no_permission_check option is set (#7017).
git-svn-id: http://svn.redmine.org/redmine/trunk@15093 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/mail_handler.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index dad13ebf8..cff397a52 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -314,7 +314,7 @@ class MailHandler < ActionMailer::Base # Adds To and Cc as watchers of the given object if the sender has the # appropriate permission def add_watchers(obj) - if user.allowed_to?("add_#{obj.class.name.underscore}_watchers".to_sym, obj.project) + if handler_options[:no_permission_check] || user.allowed_to?("add_#{obj.class.name.underscore}_watchers".to_sym, obj.project) addresses = [email.to, email.cc].flatten.compact.uniq.collect {|a| a.strip.downcase} unless addresses.empty? users = User.active.having_mail(addresses).to_a |