Class: CleanArchitecture::Checks::Authorization

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/clean_architecture/checks/authorization.rb

Instance Method Summary collapse

Instance Method Details

#resultObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/clean_architecture/checks/authorization.rb', line 12

def result
  if authorized?
    Dry::Monads::Success(true)
  else
    failure_details = Entities::FailureDetails.new(
      message: failure_message,
      other_properties: {},
      type: 'unauthorized'
    )
    Dry::Monads::Failure(failure_details)
  end
end