Sha256: 22e87fbee87fbc6b284d1b5143235fcbffa89cca284cdfaecf4f648246e12bb2

Contents?: true

Size: 797 Bytes

Versions: 16

Compression:

Stored size: 797 Bytes

Contents

# frozen_string_literal: true

module Hyrax
  ##
  # The Valkyrie model for embargoes.
  #
  # @note Embargo and Lease can, in principle, be collapsed into a single model
  #   with a `#visibility_during`, `#visibility_after`, `#end_date`, and
  #   `#history`. We haven't made this transition in order to simplify legacy
  #   support for `Hydra::AccessControls`.
  class Embargo < Valkyrie::Resource
    attribute :visibility_after_embargo,  Valkyrie::Types::String
    attribute :visibility_during_embargo, Valkyrie::Types::String
    attribute :embargo_release_date,      Valkyrie::Types::DateTime
    attribute :embargo_history,           Valkyrie::Types::Array

    def active?
      (embargo_release_date.present? && Hyrax::TimeService.time_in_utc < embargo_release_date)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/models/hyrax/embargo.rb
hyrax-5.0.4 app/models/hyrax/embargo.rb
hyrax-5.0.3 app/models/hyrax/embargo.rb
hyrax-5.0.2 app/models/hyrax/embargo.rb
hyrax-5.0.1 app/models/hyrax/embargo.rb
hyrax-5.0.0 app/models/hyrax/embargo.rb
hyrax-5.0.0.rc3 app/models/hyrax/embargo.rb
hyrax-5.0.0.rc2 app/models/hyrax/embargo.rb
hyrax-5.0.0.rc1 app/models/hyrax/embargo.rb
hyrax-3.6.0 app/models/hyrax/embargo.rb
hyrax-4.0.0 app/models/hyrax/embargo.rb
hyrax-4.0.0.rc3 app/models/hyrax/embargo.rb
hyrax-4.0.0.rc2 app/models/hyrax/embargo.rb
hyrax-4.0.0.rc1 app/models/hyrax/embargo.rb
hyrax-3.5.0 app/models/hyrax/embargo.rb
hyrax-4.0.0.beta2 app/models/hyrax/embargo.rb