summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Product.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/Product.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/Product.pm')
-rw-r--r--Bugzilla/Product.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm
index 0228aca02..c993905db 100644
--- a/Bugzilla/Product.pm
+++ b/Bugzilla/Product.pm
@@ -913,6 +913,17 @@ sub check_product {
return $product;
}
+sub check {
+ my ($class, $params) = @_;
+ $params = { name => $params } if !ref $params;
+ $params->{_error} = 'product_access_denied';
+ my $product = $class->SUPER::check($params);
+ if (!Bugzilla->user->can_access_product($product)) {
+ ThrowUserError('product_access_denied', $params);
+ }
+ return $product;
+}
+
1;
__END__