tab/app/models/user_ability.rb
David Vandorpe 5472067004
Revert "Fix permissions"
This reverts commit 8285874483.
2018-03-21 19:39:41 +01:00

15 lines
398 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 :manage, Request, creditor_id: user.id
can :manage, Notification, user_id: user.id
can :create, Transaction do |t|
t.debtor == user && t.amount <= Rails.application.config.maximum_amount
end
end
end