fix: Allow the borrower to delete a completed / inactive loan, too.

This commit is contained in:
Ed Hennis
2025-08-27 15:24:58 -04:00
parent 2aebeeb966
commit 044697c438

View File

@@ -86,10 +86,11 @@ LoanDelete::preclaim(PreclaimContext const& ctx)
// should be impossible
return tecINTERNAL; // LCOV_EXCL_LINE
}
if (loanBrokerSle->at(sfOwner) != account)
if (loanBrokerSle->at(sfOwner) != account &&
loanSle->at(sfBorrower) != account)
{
JLOG(ctx.j.warn())
<< "LoanBroker for Loan does not belong to the account.";
<< "Account is not Loan Broker Owner or Loan Borrower.";
return tecNO_PERMISSION;
}