tap/app/models/ability.rb
2015-01-06 20:18:01 +01:00

15 lines
286 B
Ruby

class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest user (not logged in)
if user.admin?
can :manage, :all
can :schulden, :admins
elsif user.koelkast?
can :manage, Order
else
can :read, :all
end
end
end