mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:15:05 +08:00
Move UploadSecurity public types into PUBLIC_TYPES constant
* this is so plugins can extend the public types if required
This commit is contained in:
parent
5cea4a6cc2
commit
36841210fb
|
@ -14,6 +14,7 @@
|
|||
# on the current secure? status, otherwise there would be a lot of additional
|
||||
# complex queries and joins to perform.
|
||||
class UploadSecurity
|
||||
PUBLIC_TYPES = %w[avatar custom_emoji profile_background card_background]
|
||||
def initialize(upload, opts = {})
|
||||
@upload = upload
|
||||
@opts = opts
|
||||
|
@ -53,7 +54,7 @@ class UploadSecurity
|
|||
end
|
||||
|
||||
def public_type?
|
||||
%w[avatar custom_emoji profile_background card_background].include?(@upload_type)
|
||||
PUBLIC_TYPES.include?(@upload_type)
|
||||
end
|
||||
|
||||
def uploading_in_composer?
|
||||
|
|
Loading…
Reference in New Issue
Block a user