diff --git a/MANIFEST b/MANIFEST index 377def3c4e..bfd736557d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2204,6 +2204,7 @@ t/scenarios/backend_http_readonly/t/300-controller_showlog.t t/scenarios/backend_http_readonly/t/300-controller_status.t t/scenarios/backend_http_readonly/t/300-controller_tac.t t/scenarios/backend_http_readonly/t/301-config-tool.t +t/scenarios/backend_http_readonly/t/301-main.t t/scenarios/backend_http_readonly/t/301-proxy.t t/scenarios/backend_http_readonly/t/301-status.t t/scenarios/backend_http_readonly/t/local/lmd.t diff --git a/lib/Thruk/Utils/CLI.pm b/lib/Thruk/Utils/CLI.pm index 711ce60059..533a4fd5e9 100644 --- a/lib/Thruk/Utils/CLI.pm +++ b/lib/Thruk/Utils/CLI.pm @@ -1220,6 +1220,10 @@ sub _authorize_function { elsif($function eq 'get_comments') { return _extend_filter($c, $opt, 'filter', 'comments'); } elsif($function eq 'get_downtimes') { return _extend_filter($c, $opt, 'filter', 'downtimes'); } elsif($function eq 'get_commands') { return _extend_filter($c, $opt, 'filter', 'commands'); } + elsif($function eq 'get_contacts') { return _extend_filter($c, $opt, 'filter', 'contacts'); } + elsif($function eq 'get_contact_names') { return _extend_filter($c, $opt, 'filter', 'contacts'); } + elsif($function eq 'get_contactgroups') { return _extend_filter($c, $opt, 'filter', 'contactgroups'); } + elsif($function eq 'get_contactgroup_names'){ return _extend_filter($c, $opt, 'filter', 'contactgroups'); } elsif($function eq 'get_logs' || $function eq 'get_logs_start_end') { return _extend_filter($c, $opt, 'filter', 'log'); } elsif($function eq 'get_timeperiods' || $function eq 'get_timeperiod_names') { diff --git a/t/scenarios/backend_http_readonly/t/301-main.t b/t/scenarios/backend_http_readonly/t/301-main.t new file mode 100644 index 0000000000..33001525eb --- /dev/null +++ b/t/scenarios/backend_http_readonly/t/301-main.t @@ -0,0 +1,19 @@ +use warnings; +use strict; +use Cpanel::JSON::XS qw/decode_json/; +use Test::More; + +die("*** ERROR: this test is meant to be run with PLACK_TEST_EXTERNALSERVER_URI set") unless defined $ENV{'PLACK_TEST_EXTERNALSERVER_URI'}; + +BEGIN { + plan tests => 13; + + use lib('t'); + require TestUtils; + import TestUtils; +} + +TestUtils::test_page( + url => '/thruk/cgi-bin/main.cgi', + like => ['Hosts UP', 'Unhandled Service', 'All Hosts'], +);