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


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

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?(user: current_user, collection_type: collection_type)
    end
  end
end