6
edits
Tag: 2017 source edit |
Tag: 2017 source edit |
||
| Line 444: | Line 444: | ||
$this->rights[$r][0] = 10001; | $this->rights[$r][0] = 10001; | ||
$this->rights[$r][1] = 'Label by default of permission'; | $this->rights[$r][1] = 'Label by default of permission'; | ||
$this->rights[$r][2] = 'r'; | |||
$this->rights[$r][3] = 1; | $this->rights[$r][3] = 1; | ||
$this->rights[$r][4] = 'action'; | $this->rights[$r][4] = 'action'; | ||
| Line 451: | Line 452: | ||
Into $this->rights[$r][0], put a permission id not already used (See into menu '''System info''' on a working installation of Dolibarr to know list of id already used by standard modules. | Into $this->rights[$r][0], put a permission id not already used (See into menu '''System info''' on a working installation of Dolibarr to know list of id already used by standard modules. | ||
Into $this->rights[$r][1], put a label by default for permission (This label will be used if no translation can be found into the file '''admin.lang''' Translation key should be "Permission10001=My permission Label"). | |||
Into $this->rights[$r][2], types of the permission. There are three type of permission, 'r' for read, list or expert permission, 'w' for write or update permission and 'd' for delete permission. | |||
Into $this->rights[$r][3], put 1 if this permission must be granted automatically by default to any newly created user. | Into $this->rights[$r][3], put 1 if this permission must be granted automatically by default to any newly created user. | ||
Into $this->rights[$r][4] and $this->rights[$r][5], put an action and subaction string without spaces. You will be able to test if a user has the permission in your PHP source code with the sequence: | Into $this->rights[$r][4] and $this->rights[$r][5], put an action and subaction string without spaces. You will be able to test if a user has the permission in your PHP source code with the sequence: | ||
edits