product
This commit is contained in:
@@ -1443,7 +1443,7 @@ function load(req, res, version) {
|
||||
let catprods = CatProd.findAllIdApp(idapp);
|
||||
let subcatprods = SubCatProd.findAllIdApp(idapp);
|
||||
let gasordines = Gasordine.findAllIdApp(idapp);
|
||||
let products = Product.findAllIdApp(idapp);
|
||||
let products = Product.findAllIdApp(idapp, undefined, undefined, User.isManager(req.user.perm));
|
||||
let productInfos = ProductInfo.findAllIdApp(idapp);
|
||||
let scontisticas = Scontistica.findAllIdApp(idapp);
|
||||
let departments = Department.findAllIdApp(idapp);
|
||||
|
||||
@@ -32,7 +32,13 @@ router.post('/', auth_default, async function (req, res, next) {
|
||||
const idapp = req.body.idapp;
|
||||
let userId = req.body.userId;
|
||||
|
||||
let products = await Product.findAllIdApp(idapp, "");
|
||||
const myuser = await User.getUserById(idapp, userId);
|
||||
let ismanager = false;
|
||||
if (myuser && myuser.perm) {
|
||||
ismanager = User.isManager(myuser.perm);
|
||||
}
|
||||
|
||||
let products = await Product.findAllIdApp(idapp, "", undefined, ismanager);
|
||||
let orders = null;
|
||||
if (await User.isManagerById(userId)) {
|
||||
// Prende Tutti gli Ordini !
|
||||
|
||||
Reference in New Issue
Block a user