From 8ec8da0491ad89604700b3e29a227966f6d84ba1 Mon Sep 17 00:00:00 2001 From: Perl Tidy Date: Wed, 5 Dec 2018 15:38:52 -0500 Subject: no bug - reformat all the code using the new perltidy rules --- extensions/BMO/lib/Reports/ProductSecurity.pm | 76 +++++++++++++-------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'extensions/BMO/lib/Reports/ProductSecurity.pm') diff --git a/extensions/BMO/lib/Reports/ProductSecurity.pm b/extensions/BMO/lib/Reports/ProductSecurity.pm index e7ccda171..fb773cd93 100644 --- a/extensions/BMO/lib/Reports/ProductSecurity.pm +++ b/extensions/BMO/lib/Reports/ProductSecurity.pm @@ -16,54 +16,54 @@ use Bugzilla::Error; use Bugzilla::Product; sub report { - my ($vars) = @_; - my $user = Bugzilla->user; + my ($vars) = @_; + my $user = Bugzilla->user; - ($user->in_group('admin') || $user->in_group('infrasec')) - || ThrowUserError('auth_failure', { group => 'admin', - action => 'run', - object => 'product_security' }); + ($user->in_group('admin') || $user->in_group('infrasec')) + || ThrowUserError('auth_failure', + {group => 'admin', action => 'run', object => 'product_security'}); - my $moco = Bugzilla::Group->new({ name => 'mozilla-employee-confidential' }) - or return; + my $moco = Bugzilla::Group->new({name => 'mozilla-employee-confidential'}) + or return; - my $products = []; - foreach my $product (@{ Bugzilla::Product->match({}) }) { - my $default_group = $product->default_security_group_obj; - my $group_controls = $product->group_controls(); + my $products = []; + foreach my $product (@{Bugzilla::Product->match({})}) { + my $default_group = $product->default_security_group_obj; + my $group_controls = $product->group_controls(); - my $item = { - name => $product->name, - default_security_group => $product->default_security_group, - group_visibility => 'None/None', - moco => exists $group_controls->{$moco->id}, - }; + my $item = { + name => $product->name, + default_security_group => $product->default_security_group, + group_visibility => 'None/None', + moco => exists $group_controls->{$moco->id}, + }; - if ($default_group) { - if (my $control = $group_controls->{$default_group->id}) { - $item->{group_visibility} = control_to_string($control->{membercontrol}) . - '/' . control_to_string($control->{othercontrol}); - } - } + if ($default_group) { + if (my $control = $group_controls->{$default_group->id}) { + $item->{group_visibility} = control_to_string($control->{membercontrol}) . '/' + . control_to_string($control->{othercontrol}); + } + } - $item->{group_problem} = $default_group ? '' : "Invalid group " . $product->default_security_group; - $item->{visibility_problem} = 'Default security group should be Shown/Shown' - if ($item->{group_visibility} ne 'Shown/Shown') - && ($item->{group_visibility} ne 'Mandatory/Mandatory') - && ($item->{group_visibility} ne 'Default/Default'); + $item->{group_problem} + = $default_group ? '' : "Invalid group " . $product->default_security_group; + $item->{visibility_problem} = 'Default security group should be Shown/Shown' + if ($item->{group_visibility} ne 'Shown/Shown') + && ($item->{group_visibility} ne 'Mandatory/Mandatory') + && ($item->{group_visibility} ne 'Default/Default'); - push @$products, $item; - } - $vars->{products} = $products; + push @$products, $item; + } + $vars->{products} = $products; } sub control_to_string { - my ($control) = @_; - return 'NA' if $control == CONTROLMAPNA; - return 'Shown' if $control == CONTROLMAPSHOWN; - return 'Default' if $control == CONTROLMAPDEFAULT; - return 'Mandatory' if $control == CONTROLMAPMANDATORY; - return ''; + my ($control) = @_; + return 'NA' if $control == CONTROLMAPNA; + return 'Shown' if $control == CONTROLMAPSHOWN; + return 'Default' if $control == CONTROLMAPDEFAULT; + return 'Mandatory' if $control == CONTROLMAPMANDATORY; + return ''; } 1; -- cgit v1.2.3-24-g4f1b