Module: Cms::Acts::ContentPage

Included in:
Tests::PretendController
Defined in:
lib/cms/acts/content_page.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/cms/acts/content_page.rb', line 21

def self.included(base)
  base.send :include, Cms::ContentRenderingSupport
  base.send :include, Cms::Authentication::Controller
  base.extend ClassMethods

  base.helper Cms::PageHelper
  base.helper Cms::RenderingHelper
  base.helper Cms::MenuHelper
end

Instance Method Details

#check_access_to_sectionObject

Before filter that determines if the current user can access a specific section.



32
33
34
35
36
37
38
39
# File 'lib/cms/acts/content_page.rb', line 32

def check_access_to_section
  user = current_user
  logger.warn "Checking that current_user '#{user.}' has access to view section with path '#{self.class.in_section}'."
  unless user.able_to_view?(self.class.in_section)
    store_location
    raise Cms::Errors::AccessDenied
  end
end