Class: Ability

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability, Pageflow::AbilityMixin
Defined in:
lib/generators/pageflow/cancan/templates/ability.rb

Instance Method Summary collapse

Methods included from Pageflow::AbilityMixin

#pageflow_default_abilities

Constructor Details

#initialize(user) ⇒ Ability

Returns a new instance of Ability


5
6
7
8
9
10
11
# File 'lib/generators/pageflow/cancan/templates/ability.rb', line 5

def initialize(user)
  # Setup abilities for Pageflow models
  pageflow_default_abilities(user)

  # Allow signed-in users to view the admin dashboard
  can :read, ActiveAdmin::Page, :name => "Dashboard"
end