Class: Hyrax::Transactions::Steps::ApplyPermissionTemplate Deprecated
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::ApplyPermissionTemplate
- Includes:
- Dry::Transaction::Operation
- Defined in:
- lib/hyrax/transactions/steps/apply_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 a permission template for a given work’s AdminSet.
Instance Method Summary collapse
Instance Method Details
#call(work) ⇒ Dry::Monads::Result
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/hyrax/transactions/steps/apply_permission_template.rb', line 19 def call(work) return Failure(:missing_permission) unless (template = work&.admin_set&.) Hyrax::PermissionTemplateApplicator.apply(template).to(model: work) Success(work) rescue ActiveRecord::RecordNotFound => err Failure(err) end |