Sha256: 2368fa86a79b0643b3ecdc845a68ae3c98e8b48cfeb921e42e0a4a65846a3ad5

Contents?: true

Size: 632 Bytes

Versions: 20

Compression:

Stored size: 632 Bytes

Contents

class Hydra::PermissionsSolrDocument < SolrDocument
  def under_embargo?
    #permissions = permissions_doc(params[:id])
    embargo_key = ActiveFedora::SolrService.solr_name("embargo_release_date", Hydra::Datastream::RightsMetadata.date_indexer)
    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

  def is_public?
    access_key = ActiveFedora::SolrService.solr_name("access", Hydra::Datastream::RightsMetadata.indexer)
    self[access_key].present? && self[access_key].first.downcase == "public"
  end
  

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
hydra-access-controls-6.3.3 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.3.2 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.3.1 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.3.0 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.3.0.rc1 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.2.2 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.2.1 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.2.0 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.1.1 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.1.0 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0.rc4 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0.rc3 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0.rc2 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0.rc1 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0.pre8 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0.pre7 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0.pre6 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0.pre5 lib/hydra/permissions_solr_document.rb
hydra-access-controls-6.0.0.pre4 lib/hydra/permissions_solr_document.rb