From d14f5d4e1330aa4efee97b7b83381619980a6819 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 6 Sep 2005 03:18:53 +0000 Subject: [PATCH] =?utf8?q?Bug=20306265:=20Implement=20User::can=5Fsee=5Fpr?= =?utf8?q?oduct()=20-=20Patch=20by=20Fr=C3=A9d=C3=A9ric=20Buclin=20=20r=3Dkiko=20a=3Djustdave?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Bugzilla/User.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 2c6c6b0b5d..ca01e0842d 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -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 + +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 Bugzilla allows for group inheritance. When data about the user (or any of the -- 2.47.2