@@ -8,6 +8,7 @@ class SnippetsPlugin extends MantisPlugin {
88 public function register () {
99 $ this ->name = plugin_lang_get ("name " );
1010 $ this ->description = plugin_lang_get ("description " );
11+ $ this ->page = "config_page " ;
1112
1213 $ this ->version = plugin_lang_get ("version " );
1314 $ this ->requires = array (
@@ -23,6 +24,8 @@ public function register() {
2324 public function config () {
2425 return array (
2526 "edit_global_threshold " => ADMINISTRATOR ,
27+ "use_global_threshold " => REPORTER ,
28+ "edit_own_threshold " => REPORTER ,
2629 );
2730 }
2831
@@ -47,17 +50,21 @@ public function init() {
4750 }
4851
4952 public function menu_account ($ event , $ user_id ) {
50- $ page = plugin_page ("snippet_list " );
51- $ label = plugin_lang_get ("list_title " );
53+ if (access_has_global_level (plugin_config_get ("edit_own_threshold " ))) {
54+ $ page = plugin_page ("snippet_list " );
55+ $ label = plugin_lang_get ("list_title " );
5256
53- return "<a href= \"{$ page }\"> {$ label }</a> " ;
57+ return "<a href= \"{$ page }\"> {$ label }</a> " ;
58+ }
5459 }
5560
5661 public function menu_manage ($ event , $ user_id ) {
57- $ page = plugin_page ("snippet_list " ) . "&global=true " ;
58- $ label = plugin_lang_get ("list_global_title " );
62+ if (access_has_global_level (plugin_config_get ("edit_global_threshold " ))) {
63+ $ page = plugin_page ("snippet_list " ) . "&global=true " ;
64+ $ label = plugin_lang_get ("list_global_title " );
5965
60- return "<a href= \"{$ page }\"> {$ label }</a> " ;
66+ return "<a href= \"{$ page }\"> {$ label }</a> " ;
67+ }
6168 }
6269
6370 public function resources ($ event ) {
0 commit comments