nulib / arch

Northwestern University institutional repository, built on Samvera's Hyrax gem.
2 stars 0 forks source link

Refactors Proquest::Metadata attributes to differentiate work and file set visibility #791

Closed bmquinn closed 2 years ago

bmquinn commented 2 years ago

Fixes #790

Description

Proquest dissertation work and file set visibility values are now based off of the DISS_access_option XML element.

The easiest way to describe see the new visibility logic is in the Proquest::Metadata spec:

Proquest::Metadata
  #proquest_metadata
    DISS_access_option open
      sets work visibility and file set visibility to open
    DISS_access_option open with an embargo
      sets work visibility and file set visibility to private
    DISS_access_option campus use only
      sets work visibility to open and file set visibility to authenticated
    DISS_access_option element not present
      sets work visibility to open and file set visibility to private

Steps to test

To run the test suite:

Note: I can't run the test and dev environments at the same time so I have to devstack -t down before spinning up the dev environment.

To manually test in dev environment:

zip = "[Absolute path to etdadmin_upload_0000_embargo_code_0_campus_only.zip spec fixture]"
package = Aws::S3::Object.new(client: Aws::S3::Client.new, bucket_name: Settings.aws.buckets.proquest, key: File.basename(zip))
package.upload_file(zip)
Proquest::Package.new(package).ingest
=> #<GenericWork id: "tx31qh68h",...>
# Grab the ID of the work from the response

Login in to arch locally and the work you ingested should have the visibility open and the file set should have the visibility northwestern

visibility

chrisdaaz commented 2 years ago

@bmquinn this is working pretty well, but i'm concerned about embargoed dissertations. i tested with a small batch this morning via the dropbox batch ingest method. there is one scenario that i'm not sure we covered:

Dissertation is embargoed but will be released to "Campus use only" after the embargo is removed.

Here's an example of a dissertation with the above conditions (from this morning's test), and below is the XML. When I check the Work Visibility settings in the edit view, it appears that the visibility will change to Public after the embargo is removed when it should be Northwestern. This is what I think caused the initial problem of dissertations becoming publicly available when the should be restricted to authenticated users.

image

<DISS_restriction>
        <DISS_sales_restriction code="1" remove="08/25/2023"/>
    </DISS_restriction>
    <DISS_repository>
        <DISS_version>2017-01-23 16:32:28</DISS_version>
        <DISS_agreement_decision_date>2020-10-16 10:35:26</DISS_agreement_decision_date>
        <DISS_acceptance>1</DISS_acceptance>
        <DISS_delayed_release>2023-08-25 00:00:00</DISS_delayed_release>
        <DISS_access_option>Campus use only</DISS_access_option>
    </DISS_repository>

thoughts?

chrisdaaz commented 2 years ago

@bmquinn just want to make sure you see this ^

that's the only unexpected thing that occurred during testing on staging (aside from #792)

bmquinn commented 2 years ago

Thanks @chrisdaaz, I'm going to look into why I didn't receive these notifications (probably a GitHub settings thing). I'll look into it!

chrisdaaz commented 2 years ago

@bmquinn retested this on staging and it looks to be working as expected now! :)

image