Fix ACL during check of uploads

This commit is contained in:
Gerhard Schlager 2024-06-27 23:06:07 +02:00 committed by cocococosti
parent 1acdb1d046
commit b9f4f51d9d
No known key found for this signature in database
GPG Key ID: FDEE4E9ED2BD9B89
1 changed files with 7 additions and 6 deletions

View File

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