summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-02 00:52:24 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-02 00:52:24 +0100
commitfde6d4aa81a56418ae5cdfd16a6b917534d66bed (patch)
treea11eb5eef41eea1db91f4fadcf901c1df7d21329 /Bugzilla/User.pm
parentcf2e1cc0ce32cefbc7c540768dd7f0a4af8407d5 (diff)
downloadbugzilla-fde6d4aa81a56418ae5cdfd16a6b917534d66bed.tar.gz
bugzilla-fde6d4aa81a56418ae5cdfd16a6b917534d66bed.tar.xz
Bug 514970: Clean up duplicates.cgi and make it use Bug objects
r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 59324383f..06c6be5cb 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -810,8 +810,8 @@ sub get_enterable_products {
}
sub can_access_product {
- my ($self, $product_name) = @_;
-
+ my ($self, $product) = @_;
+ my $product_name = blessed($product) ? $product->name : $product;
return scalar(grep {$_->name eq $product_name} @{$self->get_accessible_products});
}
@@ -2055,10 +2055,11 @@ the database again. Used mostly by L<Bugzilla::Product>.
Returns: an array of product objects.
-=item C<can_access_product(product_name)>
+=item C<can_access_product($product)>
-Returns 1 if the user can search or enter bugs into the specified product,
-and 0 if the user should not be aware of the existence of the product.
+Returns 1 if the user can search or enter bugs into the specified product
+(either a L<Bugzilla::Product> or a product name), and 0 if the user should
+not be aware of the existence of the product.
=item C<get_accessible_products>