##// END OF EJS Templates
Don't check permission to add watchers if no_permission_check option is set (#7017)....
Jean-Philippe Lang -
r14711:7dca1a180b11
parent child
Show More
@@ -314,7 +314,7 class MailHandler < ActionMailer::Base
314 # Adds To and Cc as watchers of the given object if the sender has the
314 # Adds To and Cc as watchers of the given object if the sender has the
315 # appropriate permission
315 # appropriate permission
316 def add_watchers(obj)
316 def add_watchers(obj)
317 if user.allowed_to?("add_#{obj.class.name.underscore}_watchers".to_sym, obj.project)
317 if handler_options[:no_permission_check] || user.allowed_to?("add_#{obj.class.name.underscore}_watchers".to_sym, obj.project)
318 addresses = [email.to, email.cc].flatten.compact.uniq.collect {|a| a.strip.downcase}
318 addresses = [email.to, email.cc].flatten.compact.uniq.collect {|a| a.strip.downcase}
319 unless addresses.empty?
319 unless addresses.empty?
320 users = User.active.having_mail(addresses).to_a
320 users = User.active.having_mail(addresses).to_a
General Comments 0
You need to be logged in to leave comments. Login now