Class: Padrino::Admin::AccessControl::Authorization

### Home Classes Methods

### In Files

- lib/padrino-admin/access_control.rb

### Parent

Object

### Methods

- ::new
- #allow
- #project_module
- #protect

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Admin
- Padrino::Admin::AccessControl
- Padrino::Admin::AccessControl::Authorization
- Padrino::Admin::AccessControl::Base
- Padrino::Admin::AccessControl::ProjectModule
- Padrino::Admin::AccessControlError
- Padrino::Admin::Generators
- Padrino::Admin::Generators::Orm
- Padrino::Admin::Generators::OrmError
- Padrino::Admin::Helpers
- Padrino::Admin::Helpers::AuthenticationHelpers
- Padrino::Admin::Helpers::ViewHelpers
- Padrino::Generators
- Padrino::Generators::Admin
- Padrino::Generators::Admin::Actions
- Padrino::Generators::AdminApp
- Padrino::Generators::AdminPage

No matching classes.

# Padrino::Admin::AccessControl::Authorization

Project Authorization Class.

### Attributes

allowed[R]
denied[R]
project_modules[R]
roles[R]

### Public Class Methods

new(*roles, &block) click to toggle source

    # File lib/padrino-admin/access_control.rb, line 126
    def initialize(*roles, &block)
      @roles           = roles
      @allowed         = []
      @denied          = []
      @project_modules = []
      yield self
    end

### Public Instance Methods

allow(path) click to toggle source

Allow a specified path.

    # File lib/padrino-admin/access_control.rb, line 137
    def allow(path)
      @allowed << path unless @allowed.include?(path)
    end

project_module(name, path, options={}) click to toggle source

Create a project module.

    # File lib/padrino-admin/access_control.rb, line 151
    def project_module(name, path, options={})
      allow(path)
      @project_modules << ProjectModule.new(name, path, options)
    end

protect(path) click to toggle source

Protect access from.

    # File lib/padrino-admin/access_control.rb, line 144
    def protect(path)
      @denied << path unless @denied.include?(path)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.