- my $Attachment = $self->SUPER::Next;
- return $Attachment unless $Attachment;
-
- my $txn = $Attachment->TransactionObj;
- if ( $txn->__Value('Type') eq 'Comment' ) {
- return $Attachment if $txn->CurrentUserHasRight('ShowTicketComments');
- } elsif ( $txn->CurrentUserHasRight('ShowTicket') ) {
- return $Attachment;
- }
-
- # If the user doesn't have the right to show this ticket
- return $self->Next;
+ return unless $record->TransactionObj->CurrentUserCanSee;
+ return $self->SUPER::AddRecord( $record );