FIX test on hasRight for product module
This commit is contained in:
parent
25fcc201e1
commit
1e0ce2f90a
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user