Module: Hyrax::Ability::SolrDocumentAbility

Defined in:
app/models/concerns/hyrax/ability/solr_document_ability.rb

Instance Method Summary collapse

Instance Method Details

#solr_document_abilitiesObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/models/concerns/hyrax/ability/solr_document_ability.rb', line 5

def solr_document_abilities
  if admin?
    can [:manage], ::SolrDocument
  else
    can [:edit, :update, :destroy], ::SolrDocument do |solr_doc|
      test_edit(solr_doc.id)
    end
    can :read, ::SolrDocument do |solr_doc|
      test_read(solr_doc.id)
    end
  end
end