diff options
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 7745a9809..23e07979f 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -403,6 +403,16 @@ sub check { 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; +} + sub check_is_visible { my $self = shift; my $user = Bugzilla->user; |