Skip to content

FIX document API expense report permission (v18-v19) #34368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion htdocs/api/class/api_documents.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (C) 2016 Laurent Destailleur <[email protected]>
* Copyright (C) 2016 Jean-François Ferry <[email protected]>
* Copyright (C) 2023 Romain Neil <[email protected]>
* Copyright (C) 2025 William Mead <[email protected]>
*
* 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
Expand Down Expand Up @@ -481,7 +482,7 @@ public function getDocumentsListByElement($modulepart, $id = 0, $ref = '', $sort
} 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);
}

Expand Down
Loading