[Rt-commit] rt branch, 4.0/initialdata-acl-error-checking, created. rt-4.0.2-186-g695b1ae

Kevin Falcone falcone at bestpractical.com
Tue Oct 11 19:04:24 EDT 2011


The branch, 4.0/initialdata-acl-error-checking has been created
        at  695b1ae83c1018ecf6711af59d64d8d11a9800b7 (commit)

- Log -----------------------------------------------------------------
commit 695b1ae83c1018ecf6711af59d64d8d11a9800b7
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Oct 11 18:06:40 2011 -0400

    Check that the Group/User we're granting to was loaded
    
    Otherwise the GrantRight error message is really hard to debug

diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index f350beb..d610112 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -945,9 +945,16 @@ sub InsertData {
                 } else {
                   $princ->Load( $item->{'GroupId'} );
                 }
+                unless ( $princ->Id ) {
+                    RT->Logger->error("Unable to load Group: GroupDomain => $item->{GroupDomain}, GroupId => $item->{GroupId}, Queue => $item->{Queue}");
+                    next;
+                }
             } else {
                 $princ = RT::User->new(RT->SystemUser);
-                $princ->Load( $item->{'UserId'} );
+                my ($ok, $msg) = $princ->Load( $item->{'UserId'} );
+                unless ( $ok ) {
+                    RT->Logger->error("Unable to load user: $item->{UserId} : $msg");
+                }
             }
 
             # Grant it

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


More information about the Rt-commit mailing list