From c094a6c43ed41c0af0027cd27399a9eaf683f065 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 May 2018 12:29:58 +0200 Subject: [PATCH] Reorder permissions --- htdocs/core/lib/security.lib.php | 4 +- htdocs/core/modules/modFournisseur.class.php | 45 ++++++++------------ 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index f89bba09a76..45a96f9a527 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -191,9 +191,9 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu // Get more permissions checks from hooks $parameters=array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select); $reshook=$hookmanager->executeHooks('restrictedArea',$parameters); - if (! empty($hookmanager->resArray['result']) return true; + if (! empty($hookmanager->resArray['result'])) return true; if ($reshook > 0) return false; - + // Features/modules to check $featuresarray = array($features); if (preg_match('/&/', $features)) $featuresarray = explode("&", $features); diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 69e749a4c92..cfac00e14c1 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -165,14 +165,6 @@ class modFournisseur extends DolibarrModules $this->rights[$r][4] = 'commande'; $this->rights[$r][5] = 'approuver'; - /*$r++; - $this->rights[$r][0] = 1191; - $this->rights[$r][1] = 'Approuver une commande fournisseur (si supérieur hiérarchique)'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'approve_ifsupervisor_advance';*/ - $r++; $this->rights[$r][0] = 1186; $this->rights[$r][1] = 'Commander une commande fournisseur'; @@ -205,6 +197,24 @@ class modFournisseur extends DolibarrModules $this->rights[$r][4] = 'commande'; $this->rights[$r][5] = 'supprimer'; + if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) + { + $r++; + $this->rights[$r][0] = 1190; + $this->rights[$r][1] = 'Approve supplier order (second level)'; // $langs->trans("Permission1190"); + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'commande'; + $this->rights[$r][5] = 'approve2'; + } + + $r++; + $this->rights[$r][0] = 1191; + $this->rights[$r][1] = 'Exporter les commande fournisseurs, attributs'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'commande'; + $this->rights[$r][5] = 'export'; $r++; $this->rights[$r][0] = 1231; @@ -254,25 +264,6 @@ class modFournisseur extends DolibarrModules $this->rights[$r][4] = 'facture'; $this->rights[$r][5] = 'export'; - $r++; - $this->rights[$r][0] = 1237; - $this->rights[$r][1] = 'Exporter les commande fournisseurs, attributs'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'export'; - - if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) - { - $r++; - $this->rights[$r][0] = 1190; - $this->rights[$r][1] = 'Approve supplier order (second level)'; // $langs->trans("Permission1190"); - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'approve2'; - } - // Menus //-------