diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index eaaa29d7aa1..075059fefda 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -149,6 +149,8 @@ class DolibarrApiAccess implements iAuthenticate } $fuser->getrights(); static::$user = $fuser; + + // Set the global variable $user to the $user of API $user = $fuser; if ($fuser->socid) {