line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $HeadURL: https://svn.oucs.ox.ac.uk/people/oliver/pub/librpc-serialized-perl/trunk/lib/RPC/Serialized/ACL/Group.pm $ |
3
|
|
|
|
|
|
|
# $LastChangedRevision: 1326 $ |
4
|
|
|
|
|
|
|
# $LastChangedDate: 2008-10-01 16:16:56 +0100 (Wed, 01 Oct 2008) $ |
5
|
|
|
|
|
|
|
# $LastChangedBy: oliver $ |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
package RPC::Serialized::ACL::Group; |
8
|
|
|
|
|
|
|
{ |
9
|
|
|
|
|
|
|
$RPC::Serialized::ACL::Group::VERSION = '1.123630'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
4
|
|
9210
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
142
|
|
13
|
4
|
|
|
4
|
|
20
|
use warnings FATAL => 'all'; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
130
|
|
14
|
|
|
|
|
|
|
|
15
|
4
|
|
|
4
|
|
2587
|
use URI; |
|
4
|
|
|
|
|
15665
|
|
|
4
|
|
|
|
|
110
|
|
16
|
4
|
|
|
4
|
|
2647
|
use Readonly; |
|
4
|
|
|
|
|
8149
|
|
|
4
|
|
|
|
|
224
|
|
17
|
4
|
|
|
4
|
|
1137
|
use RPC::Serialized::Exceptions; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
35
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Readonly my %schemes => ( |
20
|
|
|
|
|
|
|
'file' => sub { |
21
|
|
|
|
|
|
|
my $uri = shift; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
return 'RPC::Serialized::ACL::Group::GDBM_File' |
24
|
|
|
|
|
|
|
if $uri->file =~ /\.gdbm$/; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
return 'RPC::Serialized::ACL::Group::File'; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new { |
31
|
5
|
|
|
5
|
0
|
48337
|
my $proto = shift; |
32
|
5
|
100
|
|
|
|
225
|
my $str = shift |
33
|
|
|
|
|
|
|
or throw_app 'URI not specified'; |
34
|
|
|
|
|
|
|
|
35
|
4
|
50
|
|
|
|
35
|
my $uri = URI->new($str) |
36
|
|
|
|
|
|
|
or throw_app "Failed to parse URI '$str'"; |
37
|
|
|
|
|
|
|
|
38
|
4
|
100
|
|
|
|
11605
|
my $scheme = $uri->scheme |
39
|
|
|
|
|
|
|
or throw_app "Failed to parse scheme from URI '$str'"; |
40
|
|
|
|
|
|
|
|
41
|
3
|
100
|
|
|
|
101
|
my $map = $schemes{$scheme} |
42
|
|
|
|
|
|
|
or throw_app "Unsupported URI scheme '$scheme'"; |
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
|
|
26
|
my $class = $map->($uri); |
45
|
2
|
50
|
|
|
|
120
|
eval "require $class" |
46
|
|
|
|
|
|
|
or throw_system "Failed to load '$class': $!"; |
47
|
|
|
|
|
|
|
|
48
|
2
|
|
|
|
|
14
|
return $class->new($uri); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub is_member { |
52
|
2
|
|
|
2
|
0
|
2687
|
my $self = shift; |
53
|
2
|
|
|
|
|
5
|
my $name = shift; |
54
|
2
|
|
|
|
|
15
|
return; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub match { |
58
|
17
|
|
|
17
|
0
|
29
|
my $self = shift; |
59
|
17
|
|
|
|
|
26
|
my $name = shift; |
60
|
17
|
|
100
|
|
|
106
|
return defined($name) && $self->is_member($name); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|