Class: Ability

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability
Defined in:
lib/generators/happy_seed/roles/templates/ability.rb

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Ability

Returns a new instance of Ability.



4
5
6
7
8
# File 'lib/generators/happy_seed/roles/templates/ability.rb', line 4

def initialize(user)
  if user && user.admin?
    can :manage, :all
  end
end