Module: Cms::Acts::ContentPage::ClassMethods

Defined in:
lib/cms/acts/content_page.rb

Instance Method Summary collapse

Instance Method Details

#in_sectionObject



62
63
64
# File 'lib/cms/acts/content_page.rb', line 62

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.
options - Hash of options that will be passed to the before_filter call. See before_filter for valid options.

Example:

MyController < ApplicationController
  include Cms::Acts::ContentPage
  requires_permission_for_section "/somepath", :except=>"action_name"
...


56
57
58
59
60
# File 'lib/cms/acts/content_page.rb', line 56

def requires_permission_for_section(path, options={})
  logger.warn "Setting path #{path}"
  @section_path = path
  before_filter :check_access_to_section, options
end