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

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

Instance Method Summary collapse

Instance Method Details

#in_sectionObject



84
85
86
# File 'lib/cms/acts/content_page.rb', line 84

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"
...


78
79
80
81
82
# File 'lib/cms/acts/content_page.rb', line 78

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