Module: Hyrax::Ability::CollectionTypeAbility

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

Instance Method Summary collapse

Instance Method Details

#collection_type_abilitiesObject



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

def collection_type_abilities
  if admin?
    can :manage, CollectionType
    can :create_collection_type, CollectionType
  else
    can :create_collection_of_type, CollectionType do |collection_type|
      Hyrax::CollectionTypes::PermissionsService.can_create_collection_of_type?(ability: self, collection_type: collection_type)
    end
  end
end