Sha256: f3c811fc21edb0501e1726c48278d091f27c93a5dcc2350fab67e98729220669

Contents?: true

Size: 494 Bytes

Versions: 36

Compression:

Stored size: 494 Bytes

Contents

module Hyrax
  module Ability
    module CollectionTypeAbility
      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
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.9.5 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.9.4 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.9.3 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.9.2 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.9.1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.9.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.8.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.7.2 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.7.1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.7.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.6.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.0.pre.rc1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.0.pre.beta3 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.5.1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.5.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.0.pre.beta2 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.4.1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.0.pre.beta1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-2.4.0 app/models/concerns/hyrax/ability/collection_type_ability.rb