X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FAttachments.pm;h=b7712431e5bdf8a060374dc889bf265d061d60fc;hb=31f3763747b82764bb019cfab5b2a2945fc9a99d;hp=c640b206e9332a979b9e11631567b0196bd80bf8;hpb=43a06151e47d2c59b833cbd8c26d97865ee850b6;p=freeside.git diff --git a/rt/lib/RT/Attachments.pm b/rt/lib/RT/Attachments.pm index c640b206e..b7712431e 100755 --- a/rt/lib/RT/Attachments.pm +++ b/rt/lib/RT/Attachments.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -220,22 +220,12 @@ sub LimitByTicket { return; } -# {{{ sub Next -sub Next { +sub AddRecord { my $self = shift; + my ($record) = @_; - 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 ); }