tab/app/models/ability.rb

12 lines
213 B
Ruby
Raw Normal View History

2015-09-08 17:18:38 +02:00
class Ability
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