Class: RailsBlogEngine::Ability

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability
Defined in:
app/models/rails_blog_engine/ability.rb

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Ability

Returns a new instance of Ability.



5
6
7
8
9
10
# File 'app/models/rails_blog_engine/ability.rb', line 5

def initialize(user)
  can_read_blog
  if user && blog_admin?(user)
    can_manage_blog
  end
end