Move UploadSecurity public types into PUBLIC_TYPES constant

* this is so plugins can extend the public types if required
This commit is contained in:
Martin Brennan 2020-06-05 10:56:57 +10:00
parent 5cea4a6cc2
commit 36841210fb

View File

@ -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?