Class: Pelita::Operation::Base

Inherits:
Object
  • Object
show all
Includes:
Dry::Transaction
Defined in:
lib/pelita/operation/base.rb

Instance Method Summary collapse

Instance Method Details

#authorize!(options) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/pelita/operation/base.rb', line 8

def authorize!(options)
  if options["current_user"].signed_in?
    options["result.policy.default"] = true
    Right(options)
  else
    options["result.policy.default"] = false
    Left(options)
  end
end