Patch #31899 » MailLogger_cause_logging_improvement.diff
| mail_handler.rb (working copy) | ||
|---|---|---|
|
logger&.error "MailHandler: missing information from #{user}: #{e.message}"
|
||
|
false
|
||
|
rescue UnauthorizedAction => e
|
||
|
logger&.error "MailHandler: unauthorized attempt from #{user}"
|
||
|
logger&.error "MailHandler: unauthorized attempt from #{user}: #{e.message}"
|
||
|
false
|
||
|
end
|
||
| ... | ... | |
|
project = target_project
|
||
|
# check permission
|
||
|
unless handler_options[:no_permission_check]
|
||
|
raise UnauthorizedAction unless user.allowed_to?(:add_issues, project)
|
||
|
raise UnauthorizedAction, "User not allowed to add issues to project '#{project.name}'" unless user.allowed_to?(:add_issues, project)
|
||
|
end
|
||
|
issue = Issue.new(:author => user, :project => project)
|
||
| ... | ... | |
|
unless handler_options[:no_permission_check]
|
||
|
unless user.allowed_to?(:add_issue_notes, issue.project) ||
|
||
|
user.allowed_to?(:edit_issues, issue.project)
|
||
|
raise UnauthorizedAction
|
||
|
raise UnauthorizedAction, "User not allowed to add notes to issues on project '#{project.name}'"
|
||
|
end
|
||
|
end
|
||
| ... | ... | |
|
message = message.root
|
||
|
unless handler_options[:no_permission_check]
|
||
|
raise UnauthorizedAction unless user.allowed_to?(:add_messages, message.project)
|
||
|
raise UnauthorizedAction, "User not allowed to add messages to this project #{project.name}" unless user.allowed_to?(:add_messages, message.project)
|
||
|
end
|
||
|
if !message.locked?
|
||