Skip to content

Commit

Permalink
Merge branch 'embargo_lifting' into 'main'
Browse files Browse the repository at this point in the history
fix embargo lifting to set the permissions correctly

See merge request notch8/britishlibrary!284
  • Loading branch information
orangewolf committed Jan 25, 2022
2 parents 93b2fe4 + 6dc9967 commit e4b59e3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/models/hydra/access_controls/embargo_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OVERRIDE Hydra-access-controls 12.0.1
# Fix releasing embargos on the day they are expired - this solves a 1 second bug around how
# midnights are calculated, which causes day of embargos to incorrectly set the permissions to private
module Hydra
module AccessControls
module EmbargoDecorator
def active?
(embargo_release_date.present? && Date.yesterday.end_of_day < embargo_release_date)
end
end
end
end

Hydra::AccessControls::Embargo.prepend(Hydra::AccessControls::EmbargoDecorator)

0 comments on commit e4b59e3

Please sign in to comment.