Sha256: e4ef1f2640f215ccb1cbe3174095beb994a283a576a298fbcc330f020c13ac53
Contents?: true
Size: 971 Bytes
Versions: 22
Compression:
Stored size: 971 Bytes
Contents
# frozen_string_literal: true module Hyrax module Transactions module Steps ## # A `dry-transcation` step that applies permission templates from a # collection type on a given collection. # # @since 3.2.0 class ApplyCollectionTypePermissions include Dry::Monads[:result] ## # @param [Hyrax::PcdmCollection] collection with a collection type gid # @param user [User] the user that created the collection # # @return [Dry::Monads::Result] def call(collection, user: nil) Hyrax::Collections::PermissionsCreateService.create_default(collection: collection, creating_user: user) Success(collection) rescue URI::InvalidURIError => err # will be raised if the collection_type_gid is invalid or doesn't exist Failure(err) end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems