mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-14 08:54:21 +01:00
Fix menu accountancy not visible with module "comptabilite"
This commit is contained in:
@@ -710,6 +710,7 @@ class User extends CommonObject
|
||||
global $conf;
|
||||
// For compatibility with bad naming permissions on module
|
||||
$moduletomoduletouse = array(
|
||||
'compta' => 'comptabilite',
|
||||
'contract' => 'contrat',
|
||||
'member' => 'adherent',
|
||||
'mo' => 'mrp',
|
||||
@@ -738,7 +739,8 @@ class User extends CommonObject
|
||||
|
||||
$moduleRightsMapping = array(
|
||||
'product' => 'produit', // We must check $user->rights->produit...
|
||||
'margin' => 'margins'
|
||||
'margin' => 'margins',
|
||||
'comptabilite' => 'compta'
|
||||
);
|
||||
|
||||
$rightsPath = $module;
|
||||
@@ -760,8 +762,10 @@ class User extends CommonObject
|
||||
// In $conf->modules, we have 'accounting', 'product', 'facture', ...
|
||||
// In $user->rights, we have 'accounting', 'produit', 'facture', ...
|
||||
//var_dump($module);
|
||||
//var_dump($rightsPath);
|
||||
//var_dump($this->rights->$rightsPath);
|
||||
//var_dump($conf->modules);
|
||||
//var_dump($module.' '.isModEnabled($module).' '.$rightsPath.' '.$permlevel1.' '.$permlevel2);
|
||||
if (!isModEnabled($module)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -778,6 +782,7 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
//var_dump($this->rights);
|
||||
//var_dump($rightsPath.' '.$permlevel1.' '.$permlevel2);
|
||||
if (empty($rightsPath) || empty($this->rights) || empty($this->rights->$rightsPath) || empty($permlevel1)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user