summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Attachments.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-07 16:55:45 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-07 16:55:45 -0700
commitc24d6e2242ae0e026684b8f95decf156aba6e75e (patch)
tree8597d00e2e6bf2cf400437b9344f43b1500da412 /rt/lib/RT/Attachments.pm
parent6686c29104e555ea23446fe1db330664fa110bc0 (diff)
rt 4.0.6
Diffstat (limited to 'rt/lib/RT/Attachments.pm')
-rwxr-xr-xrt/lib/RT/Attachments.pm11
1 files changed, 4 insertions, 7 deletions
diff --git a/rt/lib/RT/Attachments.pm b/rt/lib/RT/Attachments.pm
index c640b206e..2bdbc244c 100755
--- a/rt/lib/RT/Attachments.pm
+++ b/rt/lib/RT/Attachments.pm
@@ -227,15 +227,12 @@ sub Next {
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') ) {
+ if ( $Attachment->TransactionObj->CurrentUserCanSee ) {
return $Attachment;
+ } else {
+ # If the user doesn't have the right to show this ticket
+ return $self->Next;
}
-
- # If the user doesn't have the right to show this ticket
- return $self->Next;
}