Class: Hydra::PermissionsSolrDocument

Inherits:
SolrDocument
  • Object
show all
Defined in:
app/models/hydra/permissions_solr_document.rb

Instance Method Summary collapse

Instance Method Details

#under_embargo?Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
8
9
10
# File 'app/models/hydra/permissions_solr_document.rb', line 2

def under_embargo?
  #permissions = permissions_doc(params[:id])
  embargo_key = Hydra.config.permissions.embargo.release_date
  if self[embargo_key]
    embargo_date = Date.parse(self[embargo_key].split(/T/)[0])
    return embargo_date > Date.parse(Time.now.to_s)
  end
  false
end