mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FEATURE: new 'allow_all_attachments_for_group_messages' site setting
This commit is contained in:
parent
d538bcbe40
commit
be5a54d67d
7 changed files with 72 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue