Fix bug apis (missing backported method)

i18n
Vitaliy Filippov 2017-04-24 14:26:08 +03:00
parent 9f6262a6e3
commit e08c5f3a6b
1 changed files with 11 additions and 0 deletions

View File

@ -353,6 +353,17 @@ sub check_exists
return $self;
}
sub check_for_edit
{
my $class = shift;
my $bug = $class->check(@_);
Bugzilla->user->can_edit_product($bug->product_id)
|| ThrowUserError("product_edit_denied", { product => $bug->product });
return $bug;
}
# Check if a bug exists and is visible for the current user or throw an error
sub check
{