FIX #37760
This commit is contained in:
parent
557c9bbafc
commit
27f89cc62a
1 changed files with 13 additions and 1 deletions
|
|
@ -314,8 +314,20 @@ class Proposals extends DolibarrApi
|
|||
if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
|
||||
throw new RestException(403, "Insufficiant rights");
|
||||
}
|
||||
|
||||
// Check mandatory fields
|
||||
$result = $this->_validate($request_data);
|
||||
$this->_validate($request_data);
|
||||
|
||||
// Check thirdparty validity
|
||||
$socid = (int) $request_data['socid'];
|
||||
$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') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue