From 766d27994261441f3d153445fc041f5027d74b3c Mon Sep 17 00:00:00 2001 From: moyooo Date: Sat, 19 May 2007 15:02:23 +0000 Subject: [PATCH] Rights on plugins git-svn-id: https://forge.glpi-project.org/svn/example/trunk@27 349b9182-4a13-0410-896f-e5e9767dd1b3 --- setup.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/setup.php b/setup.php index 773c3a9..11524d7 100755 --- a/setup.php +++ b/setup.php @@ -78,7 +78,6 @@ function plugin_init_example() { // Params : plugin name - string type - number - tabke - form page pluginNewType('example',"PLUGIN_EXAMPLE_TYPE",1001,"glpi_plugin_example","example.form.php"); - } @@ -93,6 +92,19 @@ function plugin_example_getDatabaseRelations(){ return array("glpi_dropdown_plugin_example"=>array("glpi_plugin_example"=>"FK_dropdown")); } + +// Define rights for the plugin types +function plugin_example_haveTypeRight($type,$right){ + switch ($type){ + case PLUGIN_EXAMPLE_TYPE : + // 1 - All rights for all users + // return true; + // 2 - Similarity right : same right of computer + return haveRight("computer",$right); + break; + } +} + // Define Dropdown tables to be manage in GLPI : function plugin_example_getDropdown(){ // Table => Name