diff --git a/htdocs/core/modules/modBookCal.class.php b/htdocs/core/modules/modBookCal.class.php index c7253d7f7f6..8163d1b696d 100644 --- a/htdocs/core/modules/modBookCal.class.php +++ b/htdocs/core/modules/modBookCal.class.php @@ -259,32 +259,32 @@ class modBookCal extends DolibarrModules $r = 0; // Add here entries to declare new permissions /* BEGIN MODULEBUILDER PERMISSIONS */ - $this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 0 + 1); + $this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 1); $this->rights[$r][1] = 'Read objects of BookCal'; $this->rights[$r][4] = 'availabilities'; $this->rights[$r][5] = 'read'; $r++; - $this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 1 + 1); + $this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 2); $this->rights[$r][1] = 'Create/Update objects of BookCal'; $this->rights[$r][4] = 'availabilities'; $this->rights[$r][5] = 'write'; $r++; - $this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 2 + 1); + $this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 3); $this->rights[$r][1] = 'Delete objects of BookCal'; $this->rights[$r][4] = 'availabilities'; $this->rights[$r][5] = 'delete'; $r++; - $this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 0 + 1); + $this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 1); $this->rights[$r][1] = 'Read Calendar object of BookCal'; $this->rights[$r][4] = 'calendar'; $this->rights[$r][5] = 'read'; $r++; - $this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 1 + 1); + $this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 2); $this->rights[$r][1] = 'Create/Update Calendar object of BookCal'; $this->rights[$r][4] = 'calendar'; $this->rights[$r][5] = 'write'; $r++; - $this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 2 + 1); + $this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 3); $this->rights[$r][1] = 'Delete Calendar object of BookCal'; $this->rights[$r][4] = 'calendar'; $this->rights[$r][5] = 'delete'; diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index a21bca32899..cbaa07c1079 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -271,17 +271,17 @@ class modMyModule extends DolibarrModules /* BEGIN MODULEBUILDER PERMISSIONS */ /* $o = 1; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + $o); // Permission id (must not be already used) + $this->rights[$r][0] = $this->numero . sprintf("%02d", ($o * 10) + 1); // Permission id (must not be already used) $this->rights[$r][1] = 'Read objects of MyModule'; // Permission label $this->rights[$r][4] = 'myobject'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->hasRight('mymodule', 'myobject', 'read')) $r++; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + $o); // Permission id (must not be already used) + $this->rights[$r][0] = $this->numero . sprintf("%02d", ($o * 10) + 2); // Permission id (must not be already used) $this->rights[$r][1] = 'Create/Update objects of MyModule'; // Permission label $this->rights[$r][4] = 'myobject'; $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->hasRight('mymodule', 'myobject', 'write')) $r++; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + $o); // Permission id (must not be already used) + $this->rights[$r][0] = $this->numero . sprintf("%02d", ($o * 10) + 3); // Permission id (must not be already used) $this->rights[$r][1] = 'Delete objects of MyModule'; // Permission label $this->rights[$r][4] = 'myobject'; $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->mymodule->myobject->delete)