Module: Hydra::EmbargoService

Defined in:
app/services/hydra/embargo_service.rb

Class Method Summary collapse

Class Method Details

.assets_under_embargoObject

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)


16
17
18
# File 'app/services/hydra/embargo_service.rb', line 16

def assets_under_embargo
  ActiveFedora::Base.where("#{Hydra.config.permissions.embargo.release_date}:[* TO *]")
end

.assets_with_deactivated_embargoesObject

Returns all assets that have had embargoes deactivated in the past.



21
22
23
# File 'app/services/hydra/embargo_service.rb', line 21

def assets_with_deactivated_embargoes
  ActiveFedora::Base.where("#{Hydra.config.permissions.embargo.history}:*")
end

.assets_with_expired_embargoesObject

Returns all assets with embargo release date set to a date in the past



9
10
11
# File 'app/services/hydra/embargo_service.rb', line 9

def assets_with_expired_embargoes
  ActiveFedora::Base.where("#{Hydra.config.permissions.embargo.release_date}:[* TO NOW]")
end