-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work edit forms list works as under embargo/lease after expiration #4299
Comments
It turns out that it's possible to deactivate the embargo, and then you get the form back. The misleading thing here is that the view code relies on some very specific Hydra::AccessControls behavior that results in the embargo release date being removed from the embargo object when it's deactivated: https://github.com/samvera/hydra-head/blob/4ffa873d713a418e03d81688d18948595951ae1d/hydra-access-controls/app/models/hydra/access_controls/embargo.rb#L22 The view should really not rely on this, and probably |
# here is an embargo with a release date in the future. it's "active" and at some
# point in the future we'll need to "deactivate" it.
embargo
# => #<Hydra::AccessControls::Embargo id: nil, visibility_during_embargo: "restricted", visibility_after_embargo: "open", embargo_release_date: "2020-05-07 00:00:00", embargo_history: []>
# this embargo is active, because it has a release date, and that date is in
# the future.
embargo.active?
# => true
# if we set the date to the past, it's no longer "active"
embargo.embargo_release_date = Date.today - 1
# => Tue, 05 May 2020
embargo.active?
# => false
# but the embargo is still in force! it will remain in force until it's "deactivated"
# (even though it's already `#active? => false`!).
# how do i know the embargo is in force(?) and needs to be deactivated?
# the way we actually check this all over the code base is to check for
# the presence of a embargo release date. if there's *any* date.
# `#active?` won't tell you this.
embargo.deactivate!
# => ["An expired embargo was deactivated on 2020-05-06. Its release date was 2020-05-05. Visibility during embargo was restricted and intended visibility after embargo was open"] can we do better? let's at least name these different things? |
Descriptive summary
When building Work forms, Hyrax displays the Embargo or Lease permissions edit partials instead of the usual edit partials whenever an embargo/lease with a release date is present. This means users can never edit visibility for an expired/released embargo.
Rationale
This issue prevents users from editing visibility for works previously under embargo.
Expected behavior
Works should allow normal permission editing after the embargo expires.
Actual behavior
The edit work page keeps the work "under embargo" forever:
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: