rights.config
Allows extending the app’s access rights settings.
Teamwork
Input (passed by reference)
$config object An instance of the
tasksRightConfig class whose method addItem() should be used to add custom access rights settings.
… your plugin code …
Output
Teamwork
Plugin code example
PHP
public function rightsConfig($config)
{
// header with the plugin’s name
$config->addItem('', $this->getName(), 'header');
// single checkbox setting
$config->addItem($this->id . '_can_do_things', _wp('Can do things'));
//multi-checkbox setting
$config->addItem($this->id . '_checkbox_group_setting', _wp('Can do the following:'), 'list', [
'items' => [
'value1' => 'option 1',
'value2' => 'option 2',
],
]);
//complex setting allowing a user to set up different access levels to several similar items (assets)
$config->addItem($this->id . '_list_setting', _wp('Can do anything of the following:'), 'selectlist', [
'items' => [
'value1' => _wp('asset 1'),
'value2' => _wp('asset 2'),
'value3' => _wp('asset 3'),
],
'options' => [
'value1' => _wp('access level'),
'value2' => _wp('another access level'),
'value3' => _wp('one more access level'),
],
]);
}









