From 85c4266b4d1b6678c5853d97966fd03e0aa3d356 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 24 Nov 2004 09:27:58 +0000 Subject: [PATCH] Nouvelle gestion des permissions --- .../modules/DolibarrModules.class.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php index ddff4d69c9c..f33635bb88f 100644 --- a/htdocs/includes/modules/DolibarrModules.class.php +++ b/htdocs/includes/modules/DolibarrModules.class.php @@ -132,6 +132,32 @@ class DolibarrModules $err++; } } + /* + * Définit les permissions associées au module activé + * + */ + if (is_array($this->rights)) + { + foreach ($this->rights as $key => $value) + { + $r_id = $this->rights[$key][0]; + $r_desc = $this->rights[$key][1]; + $r_type = $this->rights[$key][2]; + $r_def = $this->rights[$key][3]; + $r_modul = $this->rights_class; + + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def "; + $sql .= " (id, libelle, module, type, bydefault)"; + $sql .= " VALUES "; + $sql .= "(".$r_id.",'".$r_desc."','".$r_modul."','".$r_type."',".$r_def.");"; + + if ( $this->db->query($sql) ) + { + } + + } + } /* * Créé les répertoires