Sha256: f83d2faff36d6bd64c2573e6d815f5be1fc59f6b7355f07387909fc9e8339085

Contents?: true

Size: 946 Bytes

Versions: 58

Compression:

Stored size: 946 Bytes

Contents

module Hydra
  module EmbargoService
    class << self
      #
      # Methods for Querying Repository to find Embargoed Objects
      #

      # Returns all assets with embargo release date set to a date in the past
      def assets_with_expired_embargoes
        ActiveFedora::Base.where("#{Hydra.config.permissions.embargo.release_date}:[* TO NOW]")
      end

      # Returns all assets with embargo release date set
      #   (assumes that when lease visibility is applied to assets
      #    whose leases have expired, the lease expiration date will be removed from its metadata)
      def assets_under_embargo
        ActiveFedora::Base.where("#{Hydra.config.permissions.embargo.release_date}:*")
      end

      # Returns all assets that have had embargoes deactivated in the past.
      def assets_with_deactivated_embargoes
        ActiveFedora::Base.where("#{Hydra.config.permissions.embargo.history}:*")
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
hydra-access-controls-10.0.0.beta2 app/services/hydra/embargo_service.rb
hydra-access-controls-10.0.0.beta1 app/services/hydra/embargo_service.rb
hydra-access-controls-9.10.0 app/services/hydra/embargo_service.rb
hydra-access-controls-9.9.0 app/services/hydra/embargo_service.rb
hydra-access-controls-9.8.1 app/services/hydra/embargo_service.rb
hydra-access-controls-9.8.0 app/services/hydra/embargo_service.rb
hydra-access-controls-9.7.1 app/services/hydra/embargo_service.rb
hydra-access-controls-9.7.0 app/services/hydra/embargo_service.rb
hydra-access-controls-9.6.0 app/services/hydra/embargo_service.rb
hydra-access-controls-9.5.0 app/services/hydra/embargo_service.rb
hydra-access-controls-9.4.1 app/services/hydra/embargo_service.rb
hydra-access-controls-9.4.0 app/services/hydra/embargo_service.rb
hydra-access-controls-9.3.0 app/services/hydra/embargo_service.rb
hydra-access-controls-9.2.2 app/services/hydra/embargo_service.rb
hydra-access-controls-9.2.1 app/services/hydra/embargo_service.rb
hydra-access-controls-9.2.0 app/services/hydra/embargo_service.rb
hydra-access-controls-9.2.0.rc1 app/services/hydra/embargo_service.rb
hydra-access-controls-9.1.4 app/services/hydra/embargo_service.rb
hydra-access-controls-9.1.3 app/services/hydra/embargo_service.rb
hydra-access-controls-8.1.0 app/services/hydra/embargo_service.rb