Module: Cms::Acts::ContentPage::ClassMethods
- Defined in:
- lib/cms/acts/content_page.rb
Instance Method Summary collapse
- #in_section ⇒ Object
-
#requires_permission_for_section(path, options = {}) ⇒ Object
Requires that some or all of the actions on this controller require the same permissions as a specific section of the website.
Instance Method Details
#in_section ⇒ Object
83 84 85 |
# File 'lib/cms/acts/content_page.rb', line 83 def in_section @section_path end |
#requires_permission_for_section(path, options = {}) ⇒ Object
Requires that some or all of the actions on this controller require the same permissions as a specific section of the website. Note that section paths aren’t currently unique so the ‘first’ section found will be looked at.
Params:
path - Should match the 'path' attribute for a given section.
- Hash of that will be passed to the before_filter call. See before_filter for valid .
Example:
MyController < ApplicationController
include Cms::Acts::ContentPage
"/somepath", :except=>"action_name"
...
77 78 79 80 81 |
# File 'lib/cms/acts/content_page.rb', line 77 def (path, ={}) logger.warn "Setting path #{path}" @section_path = path before_filter :check_access_to_section, end |