Commit 9dba8ac0 authored by jplang's avatar jplang
Browse files

Don't check permission to add watchers if no_permission_check option is set (#7017).

git-svn-id: e93f8b46-1217-0410-a6f0-8f06a7374b81
parent b67cf6e0
......@@ -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_#{}_watchers".to_sym, obj.project)
if handler_options[:no_permission_check] || user.allowed_to?("add_#{}_watchers".to_sym, obj.project)
addresses = [,].flatten.compact.uniq.collect {|a| a.strip.downcase}
unless addresses.empty?
users =
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment