Skip to content

Commit

Permalink
Include non-approved and embargoed items in the zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Dolski committed Apr 25, 2024
1 parent 10857b6 commit c4e28c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/jobs/zip_collection_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class ZipCollectionJob < ApplicationJob
# Creates a zip file containing all of the files attached to all items in a
# collection and uploads it to the application bucket.
#
# As this job is only run by collection admins and above, non-approved and
# embargoed items may be included. We also want to align with the behavior of
# {GenerateCsvJob}, as that job and this one are the two parts of a full
# export.
#
# Upon completion, the given {Download} instance's {Download#filename}
# attribute is updated to reflect its filename within the application bucket.
#
Expand Down Expand Up @@ -41,7 +46,7 @@ def perform(**args)
# Compile a list of all item IDs to be added to the zip file.
item_ids = []
relation = Item.search.filter(Item::IndexFields::COLLECTIONS, collection_ids)
ItemPolicy::Scope.new(request_context, relation).resolve.each_id_in_batches do |result|
relation.each_id_in_batches do |result|
item_ids << result[:id]
end

Expand Down

0 comments on commit c4e28c2

Please sign in to comment.