forked from Wavyzz/dolibarr
CLOSE #18689 REST API module: add api key generate / modify right.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user