[rt-users] Creating Group and giving Rights.

JJussi rt-users at jjussi.com
Fri Jan 29 06:15:37 EST 2010


Hi to list,
(I'm not very good Perl programmer, so this question may be (too) simple)

I can create group easily:

my $group = new RT::Group($RT::SystemUser);
my $gid = $group->CreateUserDefinedGroup(
      Name              => $vars{nimi},
      Description       => $vars{kuvaus},
    );

To give rights to that group I (try) to use:

my @gacl=('ShowTicket','CreateTicket','SeeQueue','ReplyToTicket');
my $principal = new RT::Principal($RT::SystemUser);
my $pid = $principal->Create(
      PrincipalType => 'Group',
      ObjectId => $gid,
      Disabled => '0',
    );          

foreach (@gacl)
    { 
      $xxx->GrandRight( Right => $_, Object => $gid);
    }

That $xxx is problem.. I need Principal-Object there, but 
CreateUserDefinedGroup returns GroupID. How I can get that Object?

-- 
JJussi



More information about the rt-users mailing list