diff options
Diffstat (limited to 'extensions/RequestNagger/lib/Bug.pm')
-rw-r--r-- | extensions/RequestNagger/lib/Bug.pm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/extensions/RequestNagger/lib/Bug.pm b/extensions/RequestNagger/lib/Bug.pm index de6d5eae5..bd5bb7fd7 100644 --- a/extensions/RequestNagger/lib/Bug.pm +++ b/extensions/RequestNagger/lib/Bug.pm @@ -9,10 +9,22 @@ package Bugzilla::Extension::RequestNagger::Bug; use strict; use parent qw(Bugzilla::Bug); +use feature 'state'; + +use Bugzilla::User; sub short_desc { my ($self) = @_; - return $self->{secure_bug} ? '(Secure bug)' : $self->SUPER::short_desc; + return $self->{sanitise_bug} ? '(Secure bug)' : $self->SUPER::short_desc; +} + +sub is_private { + my ($self) = @_; + if (!exists $self->{is_private}) { + state $default_user //= Bugzilla::User->new(); + $self->{is_private} = !$default_user->can_see_bug($self); + } + return $self->{is_private}; } sub tooltip { @@ -21,7 +33,7 @@ sub tooltip { if ($self->bug_status eq 'RESOLVED') { $tooltip .= '/' . $self->resolution; } - if (!$self->{secure_bug}) { + if (!$self->{sanitise_bug}) { $tooltip .= ' ' . $self->product . ' :: ' . $self->component; } return $tooltip; |