FIX #37762
This commit is contained in:
parent
5586cb4583
commit
92fb9fc766
1 changed files with 13 additions and 0 deletions
|
|
@ -450,6 +450,19 @@ class Tickets extends DolibarrApi
|
|||
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
// Check thirdparty validity
|
||||
$socid = (int) $request_data['socid'];
|
||||
if ($socid > 0) {
|
||||
$thirdpartytmp = new Societe($this->db);
|
||||
$thirdparty_result = $thirdpartytmp->fetch($socid);
|
||||
if ($thirdparty_result < 1) {
|
||||
throw new RestException(404, 'Thirdparty with id='.$socid.' not found or not allowed');
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('societe', $thirdpartytmp->id)) {
|
||||
throw new RestException(404, 'Thirdparty with id='.$thirdpartytmp->id.' not found or not allowed');
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($request_data as $field => $value) {
|
||||
if ($field === 'caller') {
|
||||
// Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller
|
||||
|
|
|
|||
Loading…
Reference in a new issue