Taskodrome icon indicating copy to clipboard operation
Taskodrome copied to clipboard

Add plugin accessibility threshold

Open tezma90 opened this issue 7 years ago • 1 comments

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 avatar Oct 31 '17 14:10 tezma90

@tezma90 Works fine. Thank you very much!

user37337 avatar Jan 11 '19 14:01 user37337