diff options
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Bug.pm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 1bf5a11cd..3d9689aca 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -3614,23 +3614,23 @@ sub user { return {} if $self->{'error'}; my $user = Bugzilla->user; - my $prod_id = $self->{'product_id'}; - my $unknown_privileges = $user->in_group('editbugs', $prod_id); - my $canedit = $unknown_privileges - || $user->id == $self->{'assigned_to'} - || (Bugzilla->params->{'useqacontact'} - && $self->{'qa_contact'} - && $user->id == $self->{'qa_contact'}); - my $canconfirm = $unknown_privileges - || $user->in_group('canconfirm', $prod_id); - my $isreporter = $user->id - && $user->id == $self->{reporter_id}; + my $editbugs = $user->in_group('editbugs', $prod_id); + my $is_reporter = $user->id == $self->{reporter_id} ? 1 : 0; + my $is_assignee = $user->id == $self->{'assigned_to'} ? 1 : 0; + my $is_qa_contact = Bugzilla->params->{'useqacontact'} + && $self->{'qa_contact'} + && $user->id == $self->{'qa_contact'} ? 1 : 0; + + my $canedit = $editbugs || $is_assignee || $is_qa_contact; + my $canconfirm = $editbugs || $user->in_group('canconfirm', $prod_id); + my $has_any_role = $is_reporter || $is_assignee || $is_qa_contact; $self->{'user'} = {canconfirm => $canconfirm, canedit => $canedit, - isreporter => $isreporter}; + isreporter => $is_reporter, + has_any_role => $has_any_role}; return $self->{'user'}; } |