Merge branch 'fix_delete_company_bank_account' into new_thirdparty_notification_api

This commit is contained in:
Jon Bendtsen 2024-03-15 22:37:14 +01:00
commit a25ac083d8

View file

@ -1370,11 +1370,13 @@ class Thirdparties extends DolibarrApi
$account->fetch($bankaccount_id);
if (!$account->socid == $id) {
throw new RestException(403);
}
$socid = (int) $account->socid;
return $account->delete(DolibarrApiAccess::$user);
if ($socid == $id) {
return $account->delete(DolibarrApiAccess::$user);
} else {
throw new RestException(403, "Not allowed due to bad consistency of input data");
}
}
/**