Class: Hyrax::Transactions::Steps::DeleteAccessControl
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::DeleteAccessControl
- Defined in:
- lib/hyrax/transactions/steps/delete_access_control.rb
Overview
Deletes the Hyrax::AccessControlList for any resource with a ‘#permission_manager`. If `#permission_manager` is undefined, succeeds.
Instance Method Summary collapse
Instance Method Details
#call(obj) ⇒ Dry::Monads::Result
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/hyrax/transactions/steps/delete_access_control.rb', line 19 def call(obj) return Success(obj) unless obj.respond_to?(:permission_manager) acl = obj.&.acl return Success(obj) if acl.nil? acl.destroy || (return Failure[:failed_to_delete_acl, acl]) Success(obj) end |