[Rt-devel] Can't set user to Privilege

Paul McFerrin pmcferrin at insight.rr.com
Thu Jul 29 01:07:05 EDT 2004


[Excuse my duplicate posting.  There is a mail gateway out there that is apparently using 
snail-mail as it's transport agent!  It will come thru, eventually.]

Hello:

I'm modifying my existing command-line utility that adds users
to RT based upon information from our Corporate DB.  The modification
is to be able to toggle or set/clear the user Privilege.

Below is a code fragment to demostrate my problem:

	CleanEnv();
	RT::LoadConfig();
	RT::Init();

	$priv_rights = 1;
	$phandle = "pem";
	my $UserObj = new RT::User(RT::SystemUser);
         if( !$UserObj->Load($phandle) ) {
                 print "Can not modify non-existant user: $phandle\n";
                 exit(1);
         }
         print "Loaded user: $UserObj->Id()\n";

	# for existing users, we update Privileged
    	my  ($code, $msg) = $UserObj->SetPrivileged($priv_rights);
    	print "RC:$code - $msg\n";
     	exit(0);

When I execute the above, I'm getting:

stdout:
Loaded user: RT::User=HASH(0xb144c0)->Id()

rt.log entry:
[Thu Jul 29 04:49:36 2004] [warning]: Deep recursion on subroutine "RT::ACE::_Va
lue" at /bld/RT/perl/lib/site_perl/5.8.4/DBIx/SearchBuilder/Record.pm line 409.
  (/bld/RT/lib/RT.pm:247)

I then have to interupt it as it appears to go into a loop.

Can anyone tell me what I'm doing wrong?  I have a couple hundred
users needing modification to Privilege and I really don't want
to be forced to use GUI/Web to perform this operation.

-Paul




More information about the Rt-devel mailing list