Sha256: 4cf974c31f2ad5abb6a095e3896b9ef8475013ff6d6df21e1f3d310896e39671

Contents?: true

Size: 862 Bytes

Versions: 12

Compression:

Stored size: 862 Bytes

Contents

module Hydra
  module LeaseService
    class << self
      # Returns all assets with lease expiration date set to a date in the past
      def assets_with_expired_leases
        ActiveFedora::Base.where("#{Hydra.config.permissions.lease.expiration_date}:[* TO NOW]")
      end

      # Returns all assets with lease expiration 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_lease
        ActiveFedora::Base.where("#{Hydra.config.permissions.lease.expiration_date}:[* TO *]")
      end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hydra-access-controls-13.0.0 app/services/hydra/lease_service.rb
hydra-access-controls-12.1.0 app/services/hydra/lease_service.rb
hydra-access-controls-12.0.2 app/services/hydra/lease_service.rb
hydra-access-controls-11.0.7 app/services/hydra/lease_service.rb
hydra-access-controls-12.0.1 app/services/hydra/lease_service.rb
hydra-access-controls-11.0.6 app/services/hydra/lease_service.rb
hydra-access-controls-12.0.0 app/services/hydra/lease_service.rb
hydra-access-controls-11.0.1 app/services/hydra/lease_service.rb
hydra-access-controls-11.0.0 app/services/hydra/lease_service.rb
hydra-access-controls-11.0.0.rc2 app/services/hydra/lease_service.rb
hydra-access-controls-10.7.0 app/services/hydra/lease_service.rb
hydra-access-controls-10.6.2 app/services/hydra/lease_service.rb