line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::UnixAuth::Result; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use namespace::autoclean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
90
|
use File::DataClass::Constants qw( FALSE ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
63
|
|
6
|
1
|
|
|
1
|
|
4
|
use File::DataClass::Functions qw( is_member ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
7
|
1
|
|
|
1
|
|
5
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
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
|
2416
|
my ($self, $user) = @_; my $users = $self->members; |
|
1
|
|
|
|
|
25
|
|
22
|
|
|
|
|
|
|
|
23
|
1
|
50
|
|
|
|
9
|
is_member $user, $users and return FALSE; |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
23
|
$self->members( [ @{ $users }, $user ] ); |
|
1
|
|
|
|
|
23
|
|
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
48
|
return $self->update; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub remove_user_from_group { |
31
|
1
|
|
|
1
|
1
|
14323
|
my ($self, $user) = @_; my $users = $self->members; |
|
1
|
|
|
|
|
27
|
|
32
|
|
|
|
|
|
|
|
33
|
1
|
50
|
|
|
|
15
|
is_member $user, $users or return FALSE; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
28
|
$self->members( [ grep { $_ ne $user } @{ $users } ] ); |
|
2
|
|
|
|
|
27
|
|
|
1
|
|
|
|
|
3
|
|
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
49
|
return $self->update; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |