Fix #yogosha23803

This commit is contained in:
Laurent Destailleur
2024-08-31 13:32:58 +02:00
parent 4f51be99d0
commit afc31bca34
2 changed files with 9 additions and 7 deletions

View File

@@ -944,7 +944,7 @@ Permission776=Pay expense reports
Permission777=Read all expense reports (even those of user not subordinates)
Permission778=Create/modify expense reports of everybody
Permission779=Export expense reports
Permission1001=Read stocks
Permission1001=Read warehouses and stocks
Permission1002=Create/modify warehouses
Permission1003=Delete warehouses
Permission1004=Read stock movements

View File

@@ -42,12 +42,6 @@ $langs->loadLangs(array('products', 'stocks', 'orders'));
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('stockatdate'));
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'produit|service');
//checks if a product has been ordered
$action = GETPOST('action', 'aZ09');
@@ -119,6 +113,14 @@ if ($mode == 'future') {
}
}
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'produit|service'); // Must have permission to read product
$result = restrictedArea($user, 'stock'); // Must have permission to read stock
/*
* Actions