Sha256: 32ee9da68d7e52f01f37470fcef2e4918ba2c2a5e0e9079d841b7e0431284cf9

Contents?: true

Size: 519 Bytes

Versions: 18

Compression:

Stored size: 519 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?(ability: self, collection_type: collection_type)
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-5.0.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-5.0.0.rc3 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-5.0.0.rc2 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-5.0.0.rc1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.6.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-4.0.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-4.0.0.rc3 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-4.0.0.rc2 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-4.0.0.rc1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.5.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-4.0.0.beta2 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.4.2 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-4.0.0.beta1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.4.1 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.4.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.3.0 app/models/concerns/hyrax/ability/collection_type_ability.rb
hyrax-3.2.0 app/models/concerns/hyrax/ability/collection_type_ability.rb