SPOPS/Exception/Security.pm

filter: Statementstmt 95.2% 20 / 21 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 3 totaltotal 79.4% 27 / 34 CC 3 SCAR 6.6
CC
3
Cov
88%
to_string
3.1
spops_security_error
2.0
BEGIN
1.0
CRAP 1.9
« SPOPS/Tool/ReadOnly.pm ↑ Summary SPOPS/Exception/LDAP.pm »
1 package SPOPS::Exception::Security;
2  
3 # $Id: Security.pm,v 3.2 2004/06/02 00:48:22 lachoy Exp $
4  
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use base qw( SPOPS::Exception );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use SPOPS::Secure qw( :verbose :level );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 $SPOPS::Exception::Security::VERSION = sprintf("%d.%02d", q$Revision: 3.2 $ =~ /(\d+)\.(\d+)/);
10 3 @SPOPS::Exception::Security::EXPORT_OK = qw( spops_security_error );
11  
12 3 my @FIELDS = qw( security_required security_found );
13 3 SPOPS::Exception::Security->mk_accessors( @FIELDS );
14  
15 3 my %LEVELS = (
16 SEC_LEVEL_NONE() => SEC_LEVEL_NONE_VERBOSE,
17 SEC_LEVEL_SUMMARY() => SEC_LEVEL_SUMMARY_VERBOSE,
18 SEC_LEVEL_READ() => SEC_LEVEL_READ_VERBOSE,
19 SEC_LEVEL_WRITE() => SEC_LEVEL_WRITE_VERBOSE,
20 );
21  
22 1 ▶sub get_fields {
Subroutine get_fields: called CC=1 SCAR=0.0
Pod undocumented
23 1 return ( $_[0]->SUPER::get_fields, @FIELDS );
24 }
25  
26 0 ▶sub spops_security_error {
Subroutine spops_security_error: not called CC=1 SCAR=6.9
Pod undocumented
27 0 goto &SPOPS::Exception( 'SPOPS::Exception::Security', @_ );
28 }
29  
30 1 ▶sub to_string {
Subroutine to_string: called CC=3 SCAR=11.4
Pod undocumented
31 1 my ( $self ) = @_;
32 my $req = ( $self->security_required )
33 1 ▶ ? $LEVELS{ $self->security_required }
Branch: 1 branch
BranchTrueFalseTotal
$self->security_required ? : 1 0 1
34 : 'none specified';
35 my $fnd = ( $self->security_found )
36 1 ▶ ? $LEVELS{ $self->security_found }
Branch: 1 branch
BranchTrueFalseTotal
$self->security_found ? : 1 0 1
37 : 'none specified';
38 1 return "Security violation. Object requested [$req] and got [$fnd]";
39 }
40  
41 3 1;
42  
43 __END__
« SPOPS/Tool/ReadOnly.pm ↑ Summary SPOPS/Exception/LDAP.pm »