File Coverage

blib/lib/App/LDAP/LDIF/Group.pm
Criterion Covered Total %
statement 4 6 66.6
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 6 8 75.0


line stmt bran cond sub pod time code
1             package App::LDAP::LDIF::Group;
2              
3 1     1   5 use Modern::Perl;
  1         1  
  1         6  
4              
5 1     1   662 use Moose;
  0            
  0            
6              
7             extends qw(
8             App::LDAP::ObjectClass::PosixGroup
9             App::LDAP::LDIF
10             );
11              
12             around BUILDARGS => sub {
13             my $orig = shift;
14             my $self = shift;
15             push @_, ( dn => "cn=" .{@_}->{cn}[0] . "," . {@_}->{base} ) if grep /^base$/, @_;
16             $self->$orig(@_);
17             };
18              
19             has '+objectClass' => (
20             default => sub {
21             [
22             qw( posixGroup
23             top )
24             ]
25             },
26             );
27              
28             has '+userPassword' => (
29             default => "{crypt}x",
30             );
31              
32             __PACKAGE__->meta->make_immutable;
33             no Moose;
34              
35             1;
36              
37             =pod
38              
39             =head1 NAME
40              
41             App::LDAP::LDIF::Group - the representation of groups in LDAP
42              
43             =head1 SYNOPSIS
44              
45             my $group = App::LDAP::LDIF::Group->new(
46             base => $base, # The OU (organization unit) which the group belongs to
47             cn => [$name], # the group name
48             gidNumber => $id, # the gid of the group
49             );
50             # these three attributes are required
51              
52             my $entry = $group->entry;
53             # get the group as a instance of Net::LDAP::Entry
54              
55             my $group = App::LDAP::LDIF::Group->new($entry)
56             # new from a entry
57              
58             =cut