HasRight called with no valid object

Ehlo,

I have this curious message when running the follwing script on rt
3.6.3/RH4/Oracle9/DBIx::SearchBuilder 1.49 (with patch groupclause):

[crit]: HasRight called with no valid object
(/pkg/rt/rt/lib/RT/Principal_Overlay.pm:321)

It happen many times for SetPrivileged(0), but at the end, the function
succeed, the user is no longer Privileged.

Thanks for any hint/idea to explain/solve this :slight_smile:

The script:

====cut====
my $users_obj = new RT::Users( $CurrentUser );
$users_obj->LimitToPrivileged;
while (my $user_obj = $users_obj->Next) {
my $user_name = $user_obj->Name;
if ($user_obj->HasRight( Object=> $RT::System, Right => ‘SuperUser’)) {
print “User: $user_name skipped: SuperUser\n”;
next;
}
my $GroupMembers = RT::GroupMembers->new($CurrentUser);
$GroupMembers->Limit( FIELD => ‘MemberId’, VALUE => $user_obj->Id );
my $alias = $GroupMembers->Join(
TYPE => ‘left’,
ALIAS1 => ‘main’,
FIELD1 => ‘GroupId’,
TABLE2 => ‘Groups’,
FIELD2 => ‘id’
);
$GroupMembers->Limit(
ALIAS => $alias,
FIELD => ‘Domain’,
OPERATOR => ‘=’,
VALUE => ‘UserDefined’,
);

    my $found = 0;
    while ( my $GroupMember = $GroupMembers->Next ) {
            $found = 1;
            last;
    }
    if ($found) {
            print "User: $user_name skipped: member of one or more groups\n";
            next;
    }

            if (!grep{ $user_name eq $_} @blacklist) {
                    print "User: $user_name\n" if ($debug);
                    print "\tAction: unset privileged\n" if ($debug);
                    ($code,$msg) = $user_obj->SetPrivileged(0) if (!$dryrun);
                    print STDERR "Unprivilege FAILED: User - $user_name: $msg\n" if ($msg !~ /That user is (now|already) unprivileged/);
            }

}
====cut====

Ehlo,

I have this curious message when running the follwing script on rt
3.6.3/RH4/Oracle9/DBIx::SearchBuilder 1.49 (with patch groupclause):

[crit]: HasRight called with no valid object
(/pkg/rt/rt/lib/RT/Principal_Overlay.pm:321)

It happen many times for SetPrivileged(0), but at the end, the function
succeed, the user is no longer Privileged.

I didn’t checked the logs enough, there is lintes about RT::FM::… each
tiem HasRight Failed:

[Mon Dec 3 13:22:31 2007] [warning]: RT::ACE=HASH(0xb11c108) → Object
called for an object of an unknown type:RT::FM::Class
(/pkg/rt/rt/lib/RT/ACE_Overlay.pm:814)

Emmanuel Lacour