Module: Cms::Acts::ContentPage

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

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

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