Class: Adhoq::AuthorizationMethods::Authorizer

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/adhoq/authorization_methods.rb

Instance Method Summary collapse

Instance Method Details

#before(controller) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'app/controllers/adhoq/authorization_methods.rb', line 12

def before(controller)
  return true if authorization.call(controller)

  if failure = Adhoq.config.authorization_failure_action
    failure.call(controller)
  else
    controller.send(:render, text: 'No such file or directory', status: :not_found)
  end
end