Skip to content

Manually Embargo a Work

Bess Sadler edited this page Dec 20, 2018 · 4 revisions

Sometimes we don't catch extending an embargo in time, and it expires, and we have to re-apply it.

UI (Best Solution)

  • Take the id of the work, and open a url that looks like this:

https://staging-etd.library.emory.edu/embargoes/WORK_ID/edit

  • Follow the instructions on the screen. Typically, we want a work to be restricted (there are three flavors of restricted in this application) during embargo, and open access after embargo release. Give it an end date and click the "Update Embargo" button.

Rails Console solution

You can also do this on the rails console, like this:

 etd = Etd.find('hx11xf69w')
 require 'date'
 release_date = Date.strptime('October 18, 2020', '%B %d, %Y')
 etd.apply_embargo(release_date, "open", "open")
 etd.file_sets.each do |f|
   f.apply_embargo(release_date, "restricted", "open")
   f.save
 end
 etd.save

Check that everything is like you expect:

  1. On the console: etd.embargo_release_date should be the date you specified. So should etd.file_sets.last.embargo_release_date
  2. Go to the work in an incognito window in a browser. You should see a yellow "Embargoed" badge, and you shouldn't be able to download the file.

Note: If things are embargoed, but you don't see the embargoed file logo on the screen, try this:

  etd.files_embargoed = true
  etd.save