[Rt-commit] r7126 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Fri Mar 2 21:25:14 EST 2007


Author: ruz
Date: Fri Mar  2 21:25:14 2007
New Revision: 7126

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachment_Overlay.pm

Log:
 r4658 at cubic-pc:  cubic | 2007-03-03 05:13:00 +0300
 RT::Attachment
 * Use CurrentUserCanSee from the txn


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachment_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachment_Overlay.pm	Fri Mar  2 21:25:14 2007
@@ -520,7 +520,6 @@
 =cut
 
 sub _Value {
-
     my $self  = shift;
     my $field = shift;
 
@@ -529,23 +528,8 @@
         return ( $self->__Value( $field, @_ ) );
     }
 
-    my $txn = $self->TransactionObj;
-    # If it's a comment, we need to be extra special careful
-    if ( $txn->__Value('Type') =~ /^Comment/ ) {
-        if ( $txn->CurrentUserHasRight('ShowTicketComments') )
-        {
-            return ( $self->__Value( $field, @_ ) );
-        }
-    }
-    elsif ( $txn->CurrentUserHasRight('ShowTicket') ) {
-        return ( $self->__Value( $field, @_ ) );
-    }
-
-    #if they ain't got rights to see, don't let em
-    else {
-        return (undef);
-    }
-
+    return undef unless $self->TransactionObj->CurrentUserCanSee;
+    return $self->__Value( $field, @_ );
 }
 
 # }}}
@@ -615,10 +599,7 @@
 sub ContentLength {
     my $self = shift;
 
-    my $trx = $self->TransactionObj;
-    return undef unless ( $trx->Type eq 'Comment'
-                          && $trx->CurrentUserHasRight('ShowTicketComments')
-                        ) || $trx->CurrentUserHasRight('ShowTicket');
+    return undef unless $self->TransactionObj->CurrentUserCanSee;
 
     my $len = $self->GetHeader('Content-Length');
     unless ( defined $len ) {


More information about the Rt-commit mailing list