diff options
author | bugreport%peshkin.net <> | 2004-07-10 14:44:12 +0000 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-07-10 14:44:12 +0000 |
commit | a95006629e25bdce2016c4544318df380c91f0fd (patch) | |
tree | 86ca0fec86b70c0bfc86dabbb381da7c5c1faaa6 | |
parent | Bug 233486: Only process groups user is supposed to be able to bless in editg... (diff) | |
download | bugzilla-a95006629e25bdce2016c4544318df380c91f0fd.tar.gz bugzilla-a95006629e25bdce2016c4544318df380c91f0fd.tar.bz2 bugzilla-a95006629e25bdce2016c4544318df380c91f0fd.zip |
Bug 234855: Show only products enterable by current user in edit-multiple
patch by kiko
r=joel,justdave
a=justdave
-rwxr-xr-x | buglist.cgi | 3 | ||||
-rw-r--r-- | globals.pl | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/buglist.cgi b/buglist.cgi index caf094312..28993cbec 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -875,7 +875,8 @@ if ($dotweak) { $vars->{'dotweak'} = 1; $vars->{'use_keywords'} = 1 if @::legal_keywords; - $vars->{'products'} = \@::legal_product; + my @enterable_products = GetEnterableProducts(); + $vars->{'products'} = \@enterable_products; $vars->{'platforms'} = \@::legal_platform; $vars->{'priorities'} = \@::legal_priority; $vars->{'severities'} = \@::legal_severity; diff --git a/globals.pl b/globals.pl index a2172a998..6632833ab 100644 --- a/globals.pl +++ b/globals.pl @@ -516,6 +516,17 @@ sub CanEnterProduct { return ($ret); } +sub GetEnterableProducts { + my @products; + # XXX rewrite into pure SQL instead of relying on legal_products? + foreach my $p (@::legal_product) { + if (CanEnterProduct($p)) { + push @products, $p; + } + } + return (@products); +} + # # This function returns an alphabetical list of product names to which # the user can enter bugs. If the $by_id parameter is true, also retrieves IDs |