Module: Hyrax::Ability::ResourceAbility

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

Instance Method Summary collapse

Instance Method Details

#resource_abilitiesObject



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

def resource_abilities
  if admin?
    can [:manage], ::Hyrax::Resource
  else
    can [:edit, :update, :destroy], ::Hyrax::Resource do |res|
      test_edit(res.id)
    end
    can :read, ::Hyrax::Resource do |res|
      test_read(res.id)
    end
  end
end