diff options
author | lpsolit%gmail.com <> | 2005-09-06 05:18:53 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-09-06 05:18:53 +0200 |
commit | d14f5d4e1330aa4efee97b7b83381619980a6819 (patch) | |
tree | dcbcb884b1c76de0fe388cc7c095adb44dec84fb /Bugzilla | |
parent | 012dada9941e13b7a1b18875754ec12ee217d433 (diff) | |
download | bugzilla-d14f5d4e1330aa4efee97b7b83381619980a6819.tar.gz bugzilla-d14f5d4e1330aa4efee97b7b83381619980a6819.tar.xz |
Bug 306265: Implement User::can_see_product() - Patch by Frédéric Buclin <LpSolit@gmail.com> r=kiko a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/User.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 2c6c6b0b5..ca01e0842 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<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 |