Thank 抬头看脚趾 a ZenTao user, for sharing how to set privileges to add-on modules.
In ZenTao, all privileges of control are assigned in group/lang/resource.php (Only Admins can access controls by default.). Go to Company->Privilege and set privileges to each user.
In order to display and assign privileges of newly added control which is added to a newly added module or the current module, module/group/lang/resource.php has to be customized. The following is an example of index control on menudemo module.
1. Creat module/group/lang/resource.php in module/group/ext/lang/zh-cn/, module/group/ext/lang/zh-tw/ and module/group/ext/lang/en/
2. Add the code below to menudemo.php.
<?php $lang->resource->menudemo = new stdclass(); $lang->resource->menudemo->index = 'index';
-- global variables for privileges
-- module
-- public function in <module>/control.php
-- displayed name to be clarified in <module>/lang/en.php
3. Clarify names displayed
In order to view the assigned privileges on privilege assigning page, a clarification file has to be made. Usually it is contained in lang file.
module/menudemo/lang/en.php
$lang->menudemo->common = 'menu demo'; $lang->menudemo->index = 'Home'; $lang->menudemo->methodOrder[5] = 'index';
$lang->menudemo->methodOrder[5] = 'index' is to define the order of the name displayed.