| 50 | |
| 51 | |
| 52 | To allow only some contact group or user authorized_for_configuration_information |
| 53 | {{{ |
| 54 | #!sh |
| 55 | [demo@669ee2143112 thruk]$ pwd |
| 56 | /omd/sites/demo/etc/thruk |
| 57 | [demo@669ee2143112 thruk]$ cat menu_local.conf |
| 58 | remove_item('Reports'); |
| 59 | remove_item('General', 'Panorama View'); |
| 60 | remove_item('System', 'Configuration'); |
| 61 | |
| 62 | add_section('name' => 'General'); |
| 63 | add_link('name' => 'Home', 'href' => '/thruk/main.html'); |
| 64 | add_link('name' => 'Logout', 'href' => $c->config->{'logout_link'}, 'target' => "_parent") if($c->stash->{'cookie_auth'}); |
| 65 | |
| 66 | add_section('name' => 'Current Status'); |
| 67 | add_link('name' => 'Hosts', 'href' => '/thruk/cgi-bin/status.cgi?hostgroup=all&style=hostdetail'); |
| 68 | add_link('name' => 'Services', 'href' => '/thruk/cgi-bin/status.cgi?host=all'); |
| 69 | add_search('name' => 'Quick Search:'); |
| 70 | |
| 71 | add_section('name' => 'Logs'); |
| 72 | add_link('name' => 'Event Log', 'href' => '/thruk/cgi-bin/showlog.cgi'); |
| 73 | add_link('name' => "Trac 10", 'href' => 'https://172.17.0.2/demo/test3.html'); |
| 74 | |
| 75 | add_section('name' => 'System'); |
| 76 | add_link('name' => 'Configuration', 'href' => '/thruk/cgi-bin/config.cgi') if has_role('authorized_for_system_information', 'authorized_for_configuration_information'); |
| 77 | |
| 78 | insert_item('NewItem', { 'href' => 'https://172.17.0.2/demo/test2.html', 'name' => 'Company' }, 'target' => '_parent'); |
| 79 | |
| 80 | |
| 81 | |
| 82 | #if(has_group('demo')) { |
| 83 | # insert_item('Demo Only', { 'href' => 'https://172.17.0.2/demo/test3.html', 'name' => 'Admin Link' }); |
| 84 | #} |
| 85 | |
| 86 | if(has_role('authorized_for_configuration_information')) { |
| 87 | insert_item('Auth configure', { 'href' => 'https://172.17.0.2/demo/test3.html', 'name' => 'Conf Link' }); |
| 88 | } |
| 89 | |
| 90 | [demo@669ee2143112 thruk]$ |
| 91 | }}} |