tab/app/models/user_ability.rb
2015-09-11 13:16:53 +02:00

11 lines
217 B
Ruby

class UserAbility
include CanCan::Ability
def initialize(user)
return unless user
can :manage, :all if user.penning?
can :read, user, id: user.id
can :create, Transaction, debtor: user
end
end