From 8075cb8dba06be2cf303cacb674ffc54590349aa Mon Sep 17 00:00:00 2001 From: Kusco Date: Wed, 20 Aug 2025 17:02:09 +0200 Subject: [PATCH] FIX Updated rights management in ModuleBuilder Tabs (#34989) * Update modMyModule.class.php Actualisation de la gestion des droits dans les Tabs du ModuleBuilder * Update modMyModule.class.php * Update modMyModule.class.php * Update modMyModule.class.php * Update modMyModule.class.php --------- Co-authored-by: Laurent Destailleur --- .../template/core/modules/modMyModule.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 25b5733b467..5d9ebad18d9 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -188,13 +188,14 @@ class modMyModule extends DolibarrModules // Array to add new pages in new tabs /* BEGIN MODULEBUILDER TABS */ + // Don't forget to deactivate/reactivate your module to test your changes $this->tabs = array(); /* END MODULEBUILDER TABS */ // Example: // To add a new tab identified by code tabname1 - // $this->tabs[] = array('data' => 'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight(\'mymodule\', \'read\'):/mymodule/mynewtab1.php?id=__ID__'); + // $this->tabs[] = array('data' => 'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight('mymodule', 'myobject', 'read'):/mymodule/mynewtab1.php?id=__ID__'); // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. - // $this->tabs[] = array('data' => 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->hasRight(\'othermodule\', \'read\'):/mymodule/mynewtab2.php?id=__ID__', + // $this->tabs[] = array('data' => 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->hasRight('othermodule', 'otherobject', 'read'):/mymodule/mynewtab2.php?id=__ID__', // To remove an existing tab identified by code tabname // $this->tabs[] = array('data' => 'objecttype:-tabname:NU:conditiontoremove'); //