giving a slight better error message

This commit is contained in:
Jon Bendtsen
2025-10-30 23:19:13 +01:00
committed by Jon Bendtsen
parent 9941a20fa8
commit 36415f1fd2

View File

@@ -211,7 +211,7 @@ class Contracts extends DolibarrApi
throw new RestException(403, "Insufficient rights");
}
if (!DolibarrApiAccess::$user->hasRight('societe', 'client', 'voir')) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login.'. No read permission on thirdparties.');
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login.'. No read permission on all thirdparties.');
}
// Check mandatory fields
$result = $this->_validate($request_data);
@@ -677,7 +677,7 @@ class Contracts extends DolibarrApi
throw new RestException(403);
}
if (!DolibarrApiAccess::$user->hasRight('societe', 'client', 'voir')) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login.'. No read permission on thirdparties.');
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login.'. No read permission on all thirdparties.');
}
$result = $this->contract->fetch($id);
if (!$result) {