Sha256: 0398223010a4ae6debfc203656589a62b88d788c2c8f1fe7cc247ed8d1c1e4a7
Contents?: true
Size: 855 Bytes
Versions: 1
Compression:
Stored size: 855 Bytes
Contents
module SiteControllerExtensions def self.included(base) base.class_eval { # NB. to control access without disabling the cache we have overridden Page.cache? # to return false for any page that has a group association. def find_page_with_group_check(url) page = find_page_without_group_check(url) if page raise ReaderError::LoginRequired, t("reader_extension.page_not_public") if page.restricted? && !current_reader raise ReaderError::ActivationRequired, t("reader_extension.page_not_public") if page.restricted? && !current_reader.activated? raise ReaderError::AccessDenied, t("reader_extension.page_permission_denied") unless page.visible_to?(current_reader) end page end alias_method_chain :find_page, :group_check } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
radiant-reader-extension-3.0.13 | lib/site_controller_extensions.rb |