Sha256: 85369f7e085c2d3576113c97ed4551f575ceb2f8bd73867632242c84889d5d3c

Contents?: true

Size: 524 Bytes

Versions: 7

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true
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

7 entries across 7 versions & 1 rubygems

Version Path
hyrax-3.1.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.2 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.0.pre.rc4 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.0.pre.rc3 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.0.0.pre.rc2 app/models/concerns/hyrax/ability/collection_type_ability.rb