Parent

Methods

Files

UbiquoAccessControl::AccessControl::Parser

Public Class Methods

parse(permissions) click to toggle source

parses a list of permissions that can be strings, symbols, etc. (see access_control for the permission formats)

Returns an array where each element is a hash with the following keys:

  :permission => name of the permission as a string
  :admin => true if this permission requires to be an admin
     # File vendor/plugins/ubiquo_access_control/lib/ubiquo_access_control/access_control.rb, line 200
200:       def self.parse(permissions)
201:         [permissions].flatten.collect do |current|
202:           permission = case current
203:                        when String,Symbol
204:                          {:permission => current.to_s}
205:                        when NilClass
206:                          {:permission => nil, :admin => true}
207:                        else
208:                          current
209:                        end
210:         end.reject(&:blank?)
211:       end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.