2019-06-05 23:27:24 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Jobs
|
2019-10-02 00:01:53 -04:00
|
|
|
class UpdatePrivateUploadsAcl < ::Jobs::Base
|
2019-06-05 23:27:24 -04:00
|
|
|
# only runs when SiteSetting.prevent_anons_from_downloading_files is updated
|
|
|
|
def execute(args)
|
2019-11-19 16:46:44 -05:00
|
|
|
return if !SiteSetting.Upload.enable_s3_uploads
|
2019-06-05 23:27:24 -04:00
|
|
|
|
|
|
|
Upload.find_each do |upload|
|
2019-11-17 20:25:42 -05:00
|
|
|
if !FileHelper.is_supported_media?(upload.original_filename)
|
|
|
|
upload.update_secure_status
|
2019-06-05 23:27:24 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|