Class: Hyrax::Transactions::Steps::ApplyCollectionTypePermissions
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::ApplyCollectionTypePermissions
- Defined in:
- lib/hyrax/transactions/steps/apply_collection_type_permissions.rb
Overview
A ‘dry-transcation` step that applies permission templates from a collection type on a given collection.
Instance Method Summary collapse
Instance Method Details
#call(collection, user: nil) ⇒ Dry::Monads::Result
18 19 20 21 22 23 24 25 |
# File 'lib/hyrax/transactions/steps/apply_collection_type_permissions.rb', line 18 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 |