Class: Authmagic::Modules::Authorization

Inherits:
Object
  • Object
show all
Defined in:
lib/authmagic/rails/modules/authorization.rb

Overview

A simple authorization framework for Rails.

DEPENDENCIES

application_framework

Defined Under Namespace

Modules: ControllerClassMethods, ControllerMethods

Constant Summary collapse

DEPENDENCIES =
[:application_framework].freeze

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Authorization

Returns a new instance of Authorization.



7
8
9
10
# File 'lib/authmagic/rails/modules/authorization.rb', line 7

def initialize(context)
  @context = context
			@context.config.authorization = Config.new(:allow_guest => false)
end

Instance Method Details

#enrollObject



12
13
14
# File 'lib/authmagic/rails/modules/authorization.rb', line 12

def enroll
  @context.config.application_controller.send(:include, ControllerMethods)
end