Merge pull request #18543 from lainwir3d/fix_restapi_global_user_variable
FIX #18542 REST API: set global $user variable to DolibarrApiAccess::user
This commit is contained in:
commit
7e8ce82e0a
@ -80,7 +80,7 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
public function __isAllowed()
|
public function __isAllowed()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $db;
|
global $conf, $db, $user;
|
||||||
|
|
||||||
$login = '';
|
$login = '';
|
||||||
$stored_key = '';
|
$stored_key = '';
|
||||||
@ -150,6 +150,9 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
$fuser->getrights();
|
$fuser->getrights();
|
||||||
static::$user = $fuser;
|
static::$user = $fuser;
|
||||||
|
|
||||||
|
// Set the global variable $user to the $user of API
|
||||||
|
$user = $fuser;
|
||||||
|
|
||||||
if ($fuser->socid) {
|
if ($fuser->socid) {
|
||||||
static::$role = 'external';
|
static::$role = 'external';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user