2
0
forked from Wavyzz/dolibarr

CLOSE #18689 REST API module: add api key generate / modify right.

This commit is contained in:
lainwir3d
2021-09-12 15:47:56 +04:00
parent f8b1e4d482
commit 2fe85f2a86
3 changed files with 11 additions and 9 deletions

View File

@@ -53,7 +53,7 @@ top_httphead();
// Registering the location of boxes
if (isset($_GET['action']) && !empty($_GET['action'])) {
if ($_GET['action'] == 'getrandompassword' && $user->admin) {
if ($_GET['action'] == 'getrandompassword' && ($user->admin || $user->rights->api->apikey->generate)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$generic = $_GET['generic'] ? true : false;
echo getRandomPassword($generic);