line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::UnixAuth::Result; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use namespace::autoclean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
74
|
use File::DataClass::Constants qw( FALSE ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
62
|
|
6
|
1
|
|
|
1
|
|
6
|
use File::DataClass::Functions qw( is_member ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
7
|
1
|
|
|
1
|
|
5
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends q(File::DataClass::Result); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
after 'update' => sub { |
12
|
|
|
|
|
|
|
my $self = shift; |
13
|
|
|
|
|
|
|
my $source = $self->can( 'result_source' ) |
14
|
|
|
|
|
|
|
? $self->result_source : $self->_source; |
15
|
|
|
|
|
|
|
my $hook = $source->schema->post_update_hook; $hook and $hook->( $self ); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return; |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub add_user_to_group { |
21
|
1
|
|
|
1
|
1
|
2363
|
my ($self, $user) = @_; my $users = $self->members; |
|
1
|
|
|
|
|
25
|
|
22
|
|
|
|
|
|
|
|
23
|
1
|
50
|
|
|
|
9
|
is_member $user, $users and return FALSE; |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
24
|
$self->members( [ @{ $users }, $user ] ); |
|
1
|
|
|
|
|
23
|
|
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
46
|
return $self->update; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub remove_user_from_group { |
31
|
1
|
|
|
1
|
1
|
25475
|
my ($self, $user) = @_; my $users = $self->members; |
|
1
|
|
|
|
|
26
|
|
32
|
|
|
|
|
|
|
|
33
|
1
|
50
|
|
|
|
16
|
is_member $user, $users or return FALSE; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
58
|
$self->members( [ grep { $_ ne $user } @{ $users } ] ); |
|
2
|
|
|
|
|
29
|
|
|
1
|
|
|
|
|
4
|
|
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
50
|
return $self->update; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |