Module: Cms::Acts::CmsUser

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

Overview

Allows any ActiveRecord object to behave like a Cms User. This is a bit of an experiment being added to 3.4, so so it might be deprecated in a future version if we add something like devise.

The use case would be something like:

class AdminUser < ActiveRecord::Base
  acts_as_cms_user :groups => [Cms::Group.find_by_code('admin')]
end

where groups could be an array, proc, or instance method (as a symbol). Could be used it with authlogic to grant logins and permissions to everyone in a custom model. It's not quite a drop in authentication schema, but it does make it easier to wire up just about any model to be the current_user on CMS pages.

Defined Under Namespace

Modules: MacroMethods