diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-02-01 15:52:24 -0800 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-02-01 15:52:24 -0800 |
commit | fde6d4aa81a56418ae5cdfd16a6b917534d66bed (patch) | |
tree | a11eb5eef41eea1db91f4fadcf901c1df7d21329 /Bugzilla/Product.pm | |
parent | cf2e1cc0ce32cefbc7c540768dd7f0a4af8407d5 (diff) | |
download | bugs-fde6d4aa81a56418ae5cdfd16a6b917534d66bed.tar bugs-fde6d4aa81a56418ae5cdfd16a6b917534d66bed.tar.gz bugs-fde6d4aa81a56418ae5cdfd16a6b917534d66bed.tar.bz2 bugs-fde6d4aa81a56418ae5cdfd16a6b917534d66bed.tar.xz bugs-fde6d4aa81a56418ae5cdfd16a6b917534d66bed.zip |
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.pm | 11 |
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__ |