Fix report by Bhuvaneswaran R, Security Engineer. Bad permission test on

delete links
This commit is contained in:
Laurent Destailleur 2026-06-22 02:29:53 +02:00
parent 65a0d0e36e
commit 05268dca37

View file

@ -219,10 +219,10 @@ class ObjectLinks extends DolibarrApi
if ($this->objectlink->targettype == 'conferenceorboothattendee') {
$tgttype = 'projet';
}
if (!DolibarrApiAccess::$user->hasRight(((string) $srctype), 'lire') && !DolibarrApiAccess::$user->hasRight(((string) $srctype), 'read')) {
if (!DolibarrApiAccess::$user->hasRight(((string) $srctype), 'creer') && !DolibarrApiAccess::$user->hasRight(((string) $srctype), 'write')) {
throw new RestException(403, 'denied access to the objectlinks sourcetype');
}
if (!DolibarrApiAccess::$user->hasRight(((string) $tgttype), 'lire') && !DolibarrApiAccess::$user->hasRight(((string) $tgttype), 'read')) {
if (!DolibarrApiAccess::$user->hasRight(((string) $tgttype), 'creer') && !DolibarrApiAccess::$user->hasRight(((string) $tgttype), 'write')) {
throw new RestException(403, 'denied access to the objectlinks targettype');
}
} else {