Class: Hyrax::Transactions::Steps::DeletePermissionTemplate
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::DeletePermissionTemplate
- Defined in:
- lib/hyrax/transactions/steps/delete_permission_template.rb
Overview
Deletes the Hyrax::PermissionTemplate for a resource. If no PermissionTemplate associated with that resource is found, succeeds.
Instance Method Summary collapse
Instance Method Details
#call(obj) ⇒ Dry::Monads::Result
19 20 21 22 23 24 25 26 |
# File 'lib/hyrax/transactions/steps/delete_permission_template.rb', line 19 def call(obj) = Hyrax::PermissionTemplate.find_by(source_id: obj.id) return Success(obj) if .nil? .destroy || (return Failure[:failed_to_delete_permission_template, ]) Success(obj) end |