Taskodrome
Taskodrome copied to clipboard
Add plugin accessibility threshold
This tool might give certain users too much insight on a project inner working. A threshold level would mean that this plugin will become a manager-only tool, and not something any user can access and meddle with.
For example:
public function config()
{
$status_list = explode(',', lang_get( 'status_enum_string' ));
foreach( $status_list as $key => $value ) {
$status_list[$key] = substr($value, strpos($value, ':') + 1);
}
return array(
"status_board_order_default" => $status_list,
"status_board_order" => $status_list,
"cooldown_period_days" => 14,
"cooldown_period_hours" => 0,
"hidden_users" => array(),
"use_level" => DEVELOPER
);
}
public function menu()
{
$links = array();
if (access_has_global_level(plugin_config_get( 'use_level' )))
{
$links[] = array(
'title' => plugin_lang_get("board"),
'url' => plugin_page("main", true),
'icon' => 'fa-columns'
);
}
return $links;
}
and in main.php
access_ensure_global_level(plugin_config_get('use_level'));
@tezma90 Works fine. Thank you very much!