Class: Spina::Ability

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

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Ability

Returns a new instance of Ability.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/models/spina/ability.rb', line 5

def initialize(user)
  if user.admin?
    can :manage, :all
  else
    can :manage, Page
    can :manage, Photo
    can :manage, Attachment
    can :manage, Account
    can :manage, Inquiry

    # Engine.config.plugins.each do |plugin|
    #   can :manage, "#{plugin.class_name}".constantize
    # end
  end
end