| 1 | package App::LDAP::Command::Add::Sudoer; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use Modern::Perl; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use Moose; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | with qw( App::LDAP::Role::Command | |||||||||||||||||||
| 8 | App::LDAP::Role::Bindable ); | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 1 | has base => ( | |||||||||||||||||||
| 11 | is => "rw", | ||||||||||||||||||||
| 12 | isa => "Str", | ||||||||||||||||||||
| 13 | ); | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 1 | ▶ | use App::LDAP::LDIF::Sudoer; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 0 | ▶ | sub run { | ||||||||||||||||||
|
Subroutine
run: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||
| 18 | 0 | my ($self, ) = @_; | |||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 0 | ▶ | my $sudoername = $self->extra_argv->[2] or die "no sudoer name specified"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | die "sudoer $sudoername already exists" if App::LDAP::LDIF::Sudoer->search( | ||||||||||||||||||||
| 23 | base => config()->{sudoers_base}->[0], | ||||||||||||||||||||
| 24 | 0 | ▶ | scope => config()->{sudoers_base}->[1] // "sub", | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
config()->{"sudoers_base"}[1] // "sub"
MC/DC0%0/1
config()->{"sudoers_base"}[1] // "sub"
config()->{"sudoers_base"}[1]
Truth table0%0/2
A
A= config()->{"sudoers_base"}[1]
| |||||||||||||||||||||
| 25 | filter => "cn=$sudoername", | ||||||||||||||||||||
| 26 | ); | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | my $sudoer = App::LDAP::LDIF::Sudoer->new( | ||||||||||||||||||||
| 29 | 0 | ▶ | base => $self->base // config()->{sudoers_base}->[0], | ||||||||||||||||||
|
Condition0%0/3
$self->base // config()->{"sudoers_base"}[0]
MC/DC0%0/2
$self->base // config()->{"sudoers_base"}[0]
$self->base
config()->{"sudoers_base"}[0]
Truth table0%0/3
A // B
A= $self->baseB= config()->{"sudoers_base"}[0]
| |||||||||||||||||||||
| 30 | sudoUser => $sudoername, | ||||||||||||||||||||
| 31 | ); | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | $sudoer->save; | |||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | $sudoer; | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||
| 39 | 1 | ▶ | no Moose; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 1 | 1; | |||||||||||||||||||