app/models/ability.rb
def discover_permissions
    can :discover, String do |id|
      test_access(access: :discover, object_id: id)
    end

    can :discover,
        (ActiveFedora::Base.descendants -
         [Hydra::AccessControls::Embargo]) do |obj|

      test_access(access: :discover, object_id: obj.id)
    end

    can :discover, SolrDocument do |obj|
      cache.put(obj.id, obj)
      test_access(access: :discover, object_id: obj.id)
    end
  end
# The read and edit permissions are taken care of by the
# hydra-access-controls gem, but the discover permissions
# are not, so we define them here.
The read and edit permissions are taken care of by the
hydra-access-controls gem, but the discover permissions
are not, so we define them here.
The read and edit permissions are taken care of by the hydra - access - controls gem but the discover permissions are not so we define them here .
def discover_permissions
    can :discover, String do |id|
      test_access(access: :discover, object_id: id)
    end
    can :discover,
        (ActiveFedora::Base.descendants -
         [Hydra::AccessControls::Embargo]) do |obj|
      test_access(access: :discover, object_id: obj.id)
    end
    can :discover, SolrDocument do |obj|
      cache.put(obj.id, obj)
      test_access(access: :discover, object_id: obj.id)
    end
  end
def discover_permissions can :discover , String do | id | test_access ( access : :discover , object_id : id ) end can :discover , ( ActiveFedora :: Base . descendants - [ Hydra :: AccessControls :: Embargo ] ) do | obj | test_access ( access : :discover , object_id : obj . id ) end can :discover , SolrDocument do | obj | cache . put ( obj . id , obj ) test_access ( access : :discover , object_id : obj . id ) end end
The read and edit permissions are taken care of by the
hydra-access-controls gem, but the discover permissions
are not, so we define them here.
The read and edit permissions are taken care of by the hydra - access - controls gem but the discover permissions are not so we define them here .