[Rt-commit] rt branch, 4.0/skip-system-user-in-txns-right-check, created. rt-4.0.23-12-g6dd4614

? sunnavy sunnavy at bestpractical.com
Wed Mar 4 12:20:49 EST 2015


The branch, 4.0/skip-system-user-in-txns-right-check has been created
        at  6dd4614d38b6e58ee6b20e31717e7765be167a32 (commit)

- Log -----------------------------------------------------------------
commit 6dd4614d38b6e58ee6b20e31717e7765be167a32
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Mar 5 00:36:46 2015 +0800

    skip right check for RT->SystemUser when iterating transactions
    
    becaused outdated ObjectType field makes ->CurrentUserCanSee die.
    (->CurrentUserCanSee calls ->Object which requires correct ObjectType)
    
    one fail case is in etc/upgrade/upgrade-articles, where we iterate transactions
    to update ObjectType from "RT::FM::Article" to "RT::Article". the error is:
    Can't locate object method "new" via package "RT::FM::Article"

diff --git a/lib/RT/Transactions.pm b/lib/RT/Transactions.pm
index 9c359c0..977d815 100644
--- a/lib/RT/Transactions.pm
+++ b/lib/RT/Transactions.pm
@@ -136,7 +136,7 @@ sub AddRecord {
     my $self = shift;
     my ($record) = @_;
 
-    return unless $record->CurrentUserCanSee;
+    return unless $self->CurrentUser->PrincipalObj->Id == RT->SystemUser->Id || $record->CurrentUserCanSee;
     return $self->SUPER::AddRecord($record);
 }
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list