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

ruz at bestpractical.com ruz at bestpractical.com
Fri Apr 7 09:13:09 EDT 2006


Author: ruz
Date: Fri Apr  7 09:13:08 2006
New Revision: 4990

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

Log:
 r2370 at cubic-pc:  cubic | 2006-04-07 02:24:37 +0400
 * when we get transaction's type we MUST use internal method to get
   value without ACL check. In other case we get 'undef' that doesn't match to
   regular expression even if really transaction is comment and user can fetch
   attachment's field values if he has only ShowTicket right.


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 Apr  7 09:13:08 2006
@@ -512,14 +512,15 @@
         return ( $self->__Value( $field, @_ ) );
     }
 
-    #If it's a comment, we need to be extra special careful
-    elsif ( $self->TransactionObj->Type =~ /^Comment/ ) {
-        if ( $self->TransactionObj->CurrentUserHasRight('ShowTicketComments') )
+    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 ( $self->TransactionObj->CurrentUserHasRight('ShowTicket') ) {
+    elsif ( $txn->CurrentUserHasRight('ShowTicket') ) {
         return ( $self->__Value( $field, @_ ) );
     }
 


More information about the Rt-commit mailing list