diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index b8320b35df3..c37e8db9f6b 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2016 Jean-François Ferry * Copyright (C) 2023 Romain Neil + * Copyright (C) 2025 William Mead * * This program is free software you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -481,7 +482,7 @@ class Documents extends DolibarrApi } elseif ($modulepart == 'expensereport') { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; - if (!DolibarrApiAccess::$user->rights->expensereport->read && !DolibarrApiAccess::$user->rights->expensereport->read) { + if (!DolibarrApiAccess::$user->rights->expensereport->lire) { throw new RestException(401); }