Class: Hyrax::Transactions::Steps::EnsurePermissionTemplate Deprecated
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::EnsurePermissionTemplate
- Includes:
- Dry::Transaction::Operation
- Defined in:
- lib/hyrax/transactions/steps/ensure_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-transaction` step that ensures the input `work` has a permission template.
Instance Method Summary collapse
-
#call(work) ⇒ Dry::Monads::Result
‘Failure` if there is no `PermissionTemplate` for the input; `Success(input)`, otherwise.
Instance Method Details
#call(work) ⇒ Dry::Monads::Result
Returns ‘Failure` if there is no `PermissionTemplate` for the input; `Success(input)`, otherwise.
20 21 22 23 24 25 |
# File 'lib/hyrax/transactions/steps/ensure_permission_template.rb', line 20 def call(work) return Failure(:no_permission_template) unless Hyrax::PermissionTemplate.find_by(source_id: work.admin_set&.id) Success(work) end |