Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plugin accessibility threshold #211

Open
tezma90 opened this issue Oct 31, 2017 · 1 comment
Open

Add plugin accessibility threshold #211

tezma90 opened this issue Oct 31, 2017 · 1 comment

Comments

@tezma90
Copy link

tezma90 commented Oct 31, 2017

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'));

@user37337
Copy link

@tezma90 Works fine. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants