]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 306265: Implement User::can_see_product() - Patch by Frédéric Buclin <LpSolit...
authorlpsolit%gmail.com <>
Tue, 6 Sep 2005 03:18:53 +0000 (03:18 +0000)
committerlpsolit%gmail.com <>
Tue, 6 Sep 2005 03:18:53 +0000 (03:18 +0000)
Bugzilla/User.pm

index 2c6c6b0b5d98dd8b9b2f012608ded8c95669d45d..ca01e0842d62c132a3acb6ba0dfa9c57661f28ff 100644 (file)
@@ -415,6 +415,12 @@ sub can_see_bug {
                 || (!$missinggroup)));
 }
 
+sub can_see_product {
+    my ($self, $product_name) = @_;
+
+    return scalar(grep {$_->name eq $product_name} @{$self->get_selectable_products});
+}
+
 sub get_selectable_products {
     my ($self, $by_id) = @_;
 
@@ -1432,6 +1438,11 @@ Returns 1 if the specified user account exists and is visible to the user,
 
 Determines if the user can see the specified bug.
 
+=item C<can_see_product(product_name)>
+
+Returns 1 if the user can access the specified product, and 0 if the user
+should not be aware of the existence of the product.
+
 =item C<derive_regexp_groups>
 
 Bugzilla allows for group inheritance. When data about the user (or any of the