Fix permissions
This commit is contained in:
parent
eae4a3e99c
commit
8285874483
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue