psu-libraries / scholarsphere-3

A web application for ingest, curation, search, and display of digital assets. Powered by Hydra technologies (Rails, Hydra-head, Blacklight, Solr, Fedora Commons, etc.)
Apache License 2.0
78 stars 24 forks source link

Embargo and Lease do not show properly on the FileSet edit #1050

Closed carolyncole closed 6 years ago

carolyncole commented 7 years ago

This work is embargoed: screen shot 2017-10-23 at 10 16 24 am

The FileSet does not show the embargo during edit. screen shot 2017-10-23 at 10 14 35 am

carolyncole commented 7 years ago

Can we enable Embargoes on Files Sets? How would the users feel if that is not a possiblity?

mtribone commented 6 years ago

Existing Work I'm not able to reproduce the error. Here are my steps:

  1. Edit an existing public work
  2. Change visibility to embargo
  3. Apply changes to contents of the work
  4. Edit a fileset from the list of items in the work
  5. Select Permissions tab

screen shot 2018-03-28 at 1 51 31 pm

New Work with Emargo

  1. Create a new work
  2. Add required metadata
  3. Set visibility to embargo
  4. Add files
  5. Save
  6. Edit fileset from the list of items in the work
  7. Select Permissions tab

screen shot 2018-03-28 at 2 15 17 pm

mtribone commented 6 years ago

Leaving a note from Slack conversation

Job https://github.com/samvera/sufia/blob/master/app/jobs/attach_files_to_work_job.rb#L12

Override AttachFilesToWorkJob and add any embargoes and leases from the work to the file set. Verify that work has embargo or lease at that point.

carolyncole commented 6 years ago

Visibility is being copied down to the file set on create, but the embargo and lease is not being copied down to the file set. This could be a timing error based on the fact that the embargo or lease has not yet been created when the FileSet is attached to the work or vice versa.