FEATURE: new 'allow_all_attachments_for_group_messages' site setting

This commit is contained in:
Régis Hanol
2016-02-29 22:39:24 +01:00
parent d538bcbe40
commit be5a54d67d
7 changed files with 72 additions and 7 deletions

View File

@ -5,6 +5,8 @@ module Validators; end
class Validators::UploadValidator < ActiveModel::Validator
def validate(upload)
return true if upload.is_attachment_for_group_message && SiteSetting.allow_all_attachments_for_group_messages
extension = File.extname(upload.original_filename)[1..-1] || ""
if is_authorized?(upload, extension)