Update api_supplier_proposals.class.php

This commit is contained in:
Laurent Destailleur 2024-04-02 14:46:34 +02:00 committed by GitHub
parent f261bffd85
commit 1bf02ca858
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -105,7 +105,7 @@ class SupplierProposals extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('supplier_proposal', $this->supplier_proposal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->supplier_proposal->fetchObjectLinked();
@ -121,7 +121,7 @@ class SupplierProposals extends DolibarrApi
public function post($request_data = null)
{
if (!DolibarrApiAccess::$user->hasRight('supplier_proposal', 'creer')) {
throw new RestException(401, "Insuffisant rights");
throw new RestException(403, "Insuffisant rights");
}
// Check mandatory fields
$result = $this->_validate($request_data);
@ -168,7 +168,7 @@ class SupplierProposals extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('supplier_proposal', $this->supplier_proposal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach ($request_data as $field => $value) {
if ($field == 'id') {