Merge branch 'fix_delete_company_bank_account' into new_thirdparty_notification_api
This commit is contained in:
commit
a25ac083d8
1 changed files with 6 additions and 4 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue