FIX #18542 REST API: set global $user variable to DolibarrApiAccess::user.

This commit is contained in:
lainwir3d 2021-08-29 23:13:41 +04:00
parent 099dd44ffa
commit eecbfc0ad4

View File

@ -80,7 +80,7 @@ class DolibarrApiAccess implements iAuthenticate
public function __isAllowed()
{
// phpcs:enable
global $conf, $db;
global $conf, $db, $user;
$login = '';
$stored_key = '';
@ -149,6 +149,7 @@ class DolibarrApiAccess implements iAuthenticate
}
$fuser->getrights();
static::$user = $fuser;
$user = $fuser;
if ($fuser->socid) {
static::$role = 'external';