Fix permissions

This commit is contained in:
David Vandorpe 2018-03-13 15:27:34 +01:00
parent eae4a3e99c
commit 8285874483
No known key found for this signature in database
GPG key ID: 750319296238238A

View file

@ -9,7 +9,7 @@ class UserAbility
can :manage, Request, creditor_id: user.id can :manage, Request, creditor_id: user.id
can :manage, Notification, user_id: user.id can :manage, Notification, user_id: user.id
can :create, Transaction do |t| can :create, Transaction do |t|
t.debtor == user && t.amount <= Rails.application.config.maximum_amount t.debtor == user && (t.debtor.balance - t.amount >= 0 || t.debtor.debt_allowed?)
end end
end end
end end