From b9f4f51d9d2a5e352544ee8794f9c4adf7d2226c Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Thu, 27 Jun 2024 23:06:07 +0200 Subject: [PATCH] Fix ACL during check of uploads --- script/bulk_import/uploads_importer.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/script/bulk_import/uploads_importer.rb b/script/bulk_import/uploads_importer.rb index e47d00306e6..6405ed70d00 100644 --- a/script/bulk_import/uploads_importer.rb +++ b/script/bulk_import/uploads_importer.rb @@ -424,12 +424,13 @@ module BulkImport fake_upload.url = upload["url"] path = add_multisite_prefix(store.get_path_for_upload(fake_upload)) - file_exists = - if store.external? - store.object_from_path(path).exists? - else - File.exist?(File.join(store.public_dir, path)) - end + if store.external? + obj = store.object_from_path(path) + file_exists = obj.exists? + obj.acl.put(acl: "public-read") if file_exists + else + file_exists = File.exist?(File.join(store.public_dir, path)) + end if file_exists status_queue << { id: row["id"], upload_id: upload["id"], status: :ok }