Commit d14f5d4e authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 306265: Implement User::can_see_product() - Patch by Frédéric Buclin…

Bug 306265: Implement User::can_see_product() - Patch by Frédéric Buclin <LpSolit@gmail.com> r=kiko a=justdave
parent 012dada9
...@@ -415,6 +415,12 @@ sub can_see_bug { ...@@ -415,6 +415,12 @@ sub can_see_bug {
|| (!$missinggroup))); || (!$missinggroup)));
} }
sub can_see_product {
my ($self, $product_name) = @_;
return scalar(grep {$_->name eq $product_name} @{$self->get_selectable_products});
}
sub get_selectable_products { sub get_selectable_products {
my ($self, $by_id) = @_; my ($self, $by_id) = @_;
...@@ -1432,6 +1438,11 @@ Returns 1 if the specified user account exists and is visible to the user, ...@@ -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. 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> =item C<derive_regexp_groups>
Bugzilla allows for group inheritance. When data about the user (or any of the Bugzilla allows for group inheritance. When data about the user (or any of the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment