From 1e0ce2f90aeec43ca564c1cab597c188e8a1074f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Sep 2022 12:29:33 +0200 Subject: [PATCH] FIX test on hasRight for product module --- htdocs/user/class/user.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a09811b21fc..3ecb47f89c6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -711,7 +711,7 @@ class User extends CommonObject 'member' => 'adherent', // We must check $user->rights->adherent... 'mo' => 'mrp', 'order' => 'commande', - //'product' => 'produit', // We must check $user->rights->produit... + 'produit' => 'product', 'project' => 'projet', 'propale' => 'propal', 'shipping' => 'expedition', @@ -748,8 +748,9 @@ class User extends CommonObject $permlevel1 = $tmp[0]; } - //var_dump($module); - //var_dump($this->rights->$module); + // In $conf->modules, we have 'accounting', 'product', 'facture', ... + // In $user->rights, we have 'accounting', 'produit', 'facture', ... + //if ($a) { var_dump($module); var_dump($this->rights->$rightsPath); var_dump($conf->modules); } if (!in_array($module, $conf->modules)) { return 0; } @@ -764,7 +765,7 @@ class User extends CommonObject if ($permlevel1 == 'recruitmentcandidature') { $permlevel1 = 'recruitmentjobposition'; } - //var_dump($module.' '.$permlevel1.' '.$permlevel2. ' '. $rightsPath); + //var_dump($this->rights); if (empty($rightsPath) || empty($this->rights) || empty($this->rights->$rightsPath) || empty($permlevel1)) { return 0;