Module: Aker::Rails::SecuredController::ClassMethods

Defined in:
lib/aker/rails/secured_controller.rb

Overview

Extensions for the rails controller DSL for authentication-required controllers.

Instance Method Summary collapse

Instance Method Details

#permit(*groups) ⇒ void

This method returns an undefined value.

Tags a controller as requiring that a user both be authenticated and belong to one of a set of groups.

It delegates to Aker::Rack::Facade#permit!; see that methods’s documentation for more information.



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/aker/rails/secured_controller.rb', line 60

def permit(*groups)
  options =
    if Hash === groups.last
      groups.pop
    else
      {}
    end

  before_filter(options) do |controller|
    controller.request.env['aker.check'].permit!(*groups)
  end
end