From 0e11b4a741c9104db967a2c51fa77b071cb087f5 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 14 Oct 2015 15:53:48 +0000 Subject: Bug 1195952 - Please add the following choices to the CAB review drop down area of bugzilla --- extensions/BMO/Extension.pm | 12 +++++++++++- extensions/BMO/lib/Data.pm | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'extensions/BMO') diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 6938eb790..16caecc9a 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -549,8 +549,18 @@ sub bug_check_can_change_field { my $user = Bugzilla->user; if ($field =~ /^cf/ && !@$priv_results && $new_value ne '---') { + # Cannot use the standard %cf_setter mapping as we want anyone + # to be able to set ?, just not the other values. + if ($field eq 'cf_cab_review') { + if ($new_value ne '1' + && $new_value ne '?' + && !$user->in_group('infra', $bug->product_id)) + { + push (@$priv_results, PRIVILEGES_REQUIRED_EMPOWERED); + } + } # "other" custom field setters restrictions - if (exists $cf_setters->{$field}) { + elsif (exists $cf_setters->{$field}) { my $in_group = 0; foreach my $group (@{$cf_setters->{$field}}) { if ($user->in_group($group, $bug->product_id)) { diff --git a/extensions/BMO/lib/Data.pm b/extensions/BMO/lib/Data.pm index ab9c15353..d5a87b50a 100644 --- a/extensions/BMO/lib/Data.pm +++ b/extensions/BMO/lib/Data.pm @@ -144,6 +144,11 @@ tie(%$cf_visible_in_products, "Tie::IxHash", "Firefox" => [], "Toolkit" => [], }, + qr/^cf_cab_review$/ => { + "Developer Services" => [], + "Infrastructure & Operations Graveyard" => [], + "Infrastructure & Operations" => [], + } ); # Who to CC on particular bugmails when certain groups are added or removed. -- cgit v1.2.3-24-g4f1b