Uaf/GrantAllRule.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 47 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
grants
2.0
denies
2.0
CRAP 2.0
1 package Gantry::Plugins::Uaf::GrantAllRule;
2  
3 use 5.008;
4 use strict;
5 use warnings;
6  
7 use Gantry::Plugins::Uaf::Rule;
8 use base qw(Gantry::Plugins::Uaf::Rule);
9  
10 sub new {
11 my $proto = shift;
12  
13 my $class = ref($proto) || $proto;
14 my $self = { };
15  
16 bless ($self, $class);
17  
18 return $self;
19  
20 }
21  
22 sub grants($$$$) {
23 my $self = shift;
24 my $user = shift;
25 my $action = shift;
26 my $resource = shift;
27  
28 # Default is to allow everything
29  
30 return 1;
31  
32 }
33  
34 sub denies($$$$) {
35 my $self = shift;
36 my $user = shift;
37 my $action = shift;
38 my $resource = shift;
39  
40 # Default is to deny everything
41  
42 return 0;
43  
44 }
45  
46 1;
47  
48 __END__