Branch Coverage

blib/lib/CGI/Application/Plugin/Authorization.pm
Criterion Covered Total %
branch 81 88 92.0


line true false branch
24 1 14 if (not UNIVERSAL::isa($callpkg, 'CGI::Application')) { }
0 14 elsif (not UNIVERSAL::can($callpkg, 'add_callback')) { }
160 121 21 if (ref $cgiapp) { }
241 1 46 if $$self{'loaded'}
246 45 1 if (@_)
248 2 43 if (ref $_[0] eq 'HASH') { }
257 36 9 if (defined $$props{'DRIVER'})
258 1 35 if ref $$props{'DRIVER'} and &Scalar::Util::reftype($$props{'DRIVER'}) ne 'ARRAY'
267 2 33 if &Scalar::Util::reftype($$config{'DRIVER'}) ne 'ARRAY'
269 31 4 if &Scalar::Util::reftype($$config{'DRIVER'}[0]) ne 'ARRAY'
274 4 40 if (defined $$props{'FORBIDDEN_RUNMODE'})
275 1 3 if ref $$props{'FORBIDDEN_RUNMODE'}
282 7 36 if (defined $$props{'FORBIDDEN_URL'})
283 0 7 if $$config{'FORBIDDEN_RUNMODE'}
286 1 6 if ref $$props{'FORBIDDEN_URL'}
293 10 32 if (defined $$props{'GET_USERNAME'})
294 1 9 if ref $$props{'GET_USERNAME'} ne 'CODE'
301 1 40 if %$props
377 3 30 if (ref $_[0] eq 'ARRAY') { }
412 2 12 if (overload::StrVal($runmode_test) =~ /^Regexp=/) { }
2 10 elsif (ref $runmode_test and ref $runmode_test eq 'CODE') { }
2 8 elsif ($runmode_test eq ':all') { }
414 2 0 if $runmode =~ /$runmode_test/
417 2 0 if &$runmode_test($runmode)
423 8 0 if $runmode eq $runmode_test
449 47 21 if ref $$self{'cgiapp'}
469 2 141 unless defined $cgiapp and UNIVERSAL::isa($cgiapp, 'CGI::Application')
474 120 21 if (ref $cgiapp) { }
476 47 73 unless defined $$cgiapp{'__CAP_AUTHORIZATION_INSTANCE'}{$name}
506 14 19 if $driver->authorize(@params)
540 17 22 if ($$config{'GET_USERNAME'}) { }
1 21 elsif ($self->cgiapp->can('authen')) { }
561 27 15 unless ($$self{'drivers'})
565 26 1 defined $$config{'DRIVER'} ? :
653 14 3 if ($rule = $authz->is_authz_runmode($self->get_current_runmode))
656 2 10 ref $rule eq 'ARRAY' ? :
2 12 ref $rule eq 'CODE' ? :
658 7 7 unless $authz_ok
679 0 7 if ($$config{'FORBIDDEN_RUNMODE'}) { }
0 7 elsif ($$config{'FORBIDDEN_URL'}) { }
703 1 2 if ($$config{'FORBIDDEN_RUNMODE'}) { }
1 1 elsif ($$config{'FORBIDDEN_URL'}) { }
761 27 3 if $class->require
770 136 20 if (ref $self->cgiapp) { }