Sha256: 2dc978716bf0d2ea42f89a311cd51c1aecf3461a5cc33830750f1d17326ba9ee

Contents?: true

Size: 856 Bytes

Versions: 58

Compression:

Stored size: 856 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}:*")
      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

58 entries across 58 versions & 1 rubygems

Version Path
hydra-access-controls-10.6.1 app/services/hydra/lease_service.rb
hydra-access-controls-10.6.0 app/services/hydra/lease_service.rb
hydra-access-controls-10.5.1 app/services/hydra/lease_service.rb
hydra-access-controls-11.0.0.rc1 app/services/hydra/lease_service.rb
hydra-access-controls-10.5.0 app/services/hydra/lease_service.rb
hydra-access-controls-8.2.0 app/services/hydra/lease_service.rb
hydra-access-controls-10.4.0 app/services/hydra/lease_service.rb
hydra-access-controls-10.4.0.rc2 app/services/hydra/lease_service.rb
hydra-access-controls-10.4.0.rc1 app/services/hydra/lease_service.rb
hydra-access-controls-10.3.4 app/services/hydra/lease_service.rb
hydra-access-controls-10.3.3 app/services/hydra/lease_service.rb
hydra-access-controls-10.3.2 app/services/hydra/lease_service.rb
hydra-access-controls-10.3.0 app/services/hydra/lease_service.rb
hydra-access-controls-10.2.0 app/services/hydra/lease_service.rb
hydra-access-controls-10.1.0 app/services/hydra/lease_service.rb
hydra-access-controls-10.0.2 app/services/hydra/lease_service.rb
hydra-access-controls-10.0.1 app/services/hydra/lease_service.rb
hydra-access-controls-10.0.0 app/services/hydra/lease_service.rb
hydra-access-controls-10.0.0.beta4 app/services/hydra/lease_service.rb
hydra-access-controls-10.0.0.beta3 app/services/hydra/lease_service.rb