diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index 7ea4b553e71..ace98374461 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2023 Frédéric France * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software: you can redistribute it and/or modify @@ -101,8 +101,10 @@ class mymodulewidget1 extends ModeleBoxes $this->param = $param; - //$this->enabled = $conf->global->FEATURES_LEVEL > 0; // Condition when module is enabled or not - //$this->hidden = ! ($user->rights->mymodule->myobject->read); // Condition when module is visible by user (test on permission) + // Condition when module is enabled or not + // $this->enabled = getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0; + // Condition when module is visible by user (test on permission) + // $this->hidden = !$user->hasRight('mymodule', 'myobject', 'read'); } /**