tab/app/models/user_ability.rb

12 lines
217 B
Ruby
Raw Normal View History

2015-09-09 20:11:59 +02:00
class UserAbility
2015-09-08 17:18:38 +02:00
include CanCan::Ability
def initialize(user)
2015-09-09 16:56:55 +02:00
return unless user
2015-09-08 17:18:38 +02:00
2015-09-09 16:56:55 +02:00
can :manage, :all if user.penning?
can :read, user, id: user.id
can :create, Transaction, debtor: user
2015-09-08 17:18:38 +02:00
end
end