Methods
Included Modules
- Helper
- ActionController::UrlWriter
Attributes
| [R] | menus | |
| [R] | name | |
| [R] | url |
Public Instance methods
Return allowed controllers
[ show source ]
# File lib/access_control/base.rb, line 158
158: def allowed
159: @menus.each { |m| @allowed.concat(m.allowed) }
160: @allowed.uniq
161: end
Return ExtJs Config for this project module
[ show source ]
# File lib/access_control/base.rb, line 174
174: def config
175: options = @options.merge(:text => human_name)
176: options.merge!(:menu => @menus.collect(&:config)) if @menus.size > 0
177: options.merge!(:handler => "function(){ Backend.app.load('#{url_for(@url.merge(:only_path => true))}') }".to_l) if @url
178: options
179: end
Return the original name or try to translate or humanize the symbol
[ show source ]
# File lib/access_control/base.rb, line 164
164: def human_name
165: @name.is_a?(Symbol) ? I18n.t("backend.menus.#{@name}", :default => @name.to_s.humanize) : @name
166: end
[ show source ]
# File lib/access_control/base.rb, line 153
153: def menu(name, path=nil, options={}, &block)
154: @menus << Menu.new(name, path, options, &block)
155: end
Return a unique id for the given project module
[ show source ]
# File lib/access_control/base.rb, line 169
169: def uid
170: @name.to_s.downcase.gsub(/[^a-z0-9]+/, '').gsub(/-+$/, '').gsub(/^-+$/, '')
171: end