Methods
Included Modules
Attributes
[R] project_modules
[R] roles
Public Instance methods
allow_action(path)

Globally allow an action of a controller for the current role

    # File lib/access_control/base.rb, line 94
94:       def allow_action(path)
95:         @allowed << recognize_path(path)
96:       end
allow_all_actions(path)

Globally allow all actions from a controller for the current role

     # File lib/access_control/base.rb, line 104
104:       def allow_all_actions(path)
105:         @allowed << { :controller => recognize_path(path)[:controller] }
106:       end
allowed()

Return allowed actions/controllers

     # File lib/access_control/base.rb, line 119
119:       def allowed
120:         # I know is a double check but is better 2 times that no one.
121:         if allowed?
122:           @project_modules.each { |pm| @allowed.concat pm.allowed  }
123:           @allowed.uniq
124:         else 
125:           []
126:         end
127:       end
allowed?()

Return true if current_account role is included in given roles

     # File lib/access_control/base.rb, line 114
114:       def allowed?
115:         @roles.any? { |r| r.to_s.downcase == Account.find(@account_id).role.downcase }
116:       end
denied()

Return denied actions/controllers

     # File lib/access_control/base.rb, line 130
130:       def denied
131:         @denied.uniq
132:       end
deny_action(path)

Globally deny an action of a controllerfor the current role

     # File lib/access_control/base.rb, line 99
 99:       def deny_action(path)
100:         @denied << recognize_path(path)
101:       end
deny_all_actions(path)

Globally denty all actions from a controller for the current role

     # File lib/access_control/base.rb, line 109
109:       def deny_all_actions(path)
110:         @denied << { :controller => recognize_path(path)[:controller] }
111:       end
project_module(name, controller=nil, &block)

Create a new project module

    # File lib/access_control/base.rb, line 89
89:       def project_module(name, controller=nil, &block)
90:         @project_modules << ProjectModule.new(name, controller, &block)
91:       end