Class: Hyrax::Transactions::Steps::ApplyCollectionPermissionTemplate Deprecated
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::ApplyCollectionPermissionTemplate
- Includes:
- Dry::Transaction::Operation
- Defined in:
- lib/hyrax/transactions/steps/apply_collection_permission_template.rb
Overview
Deprecated.
This is part of the legacy AF set of transaction steps for works. Transactions are not being used with AF works. This will be removed in 4.0.
A `dry-transcation` step that applies permission templates for a set of collections on a given work.
Instance Method Summary collapse
Instance Method Details
#call(work, collections: []) ⇒ Dry::Monads::Result
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/hyrax/transactions/steps/apply_collection_permission_template.rb', line 21 def call(work, collections: []) collections.each do |collection| template = Hyrax::PermissionTemplate.find_by!(source_id: collection.id) Hyrax::PermissionTemplateApplicator.apply(template).to(model: work) end Success(work) rescue ActiveRecord::RecordNotFound => err Failure(err) end |