[rt-users] Creating Group and giving Rights.

Jarno Huuskonen jarno.huuskonen at uef.fi
Mon Feb 1 12:42:19 EST 2010


> > Something like this works for me:
> > 
> > my $queue = RT::Queue->new($RT::SystemUser);
> > $queue->Load($queuename);
> > 
> > foreach my $tmp_right (@group_rights) {
> >         my ($status, $msg) = $group->PrincipalObj->GrantRight(
> >                 Right => $tmp_right,
> >                 Object => $queue);
> > 
> > }
> > 
> 
> This didn't work.. What ever I try to do, I get: RT::Principal::GrandRight 
> Unimplemented in main.

Have you tried getting the $group with something like this:

my $group  = RT::Group->new($RT::SystemUser);
$group->LoadUserDefinedGroup($groupname);
if (! $group->id) {
	die qq([ERROR] group "$groupname" not found\n);
}

BTW I've created groups with this:
my $newgrp = RT::Group->new($RT::SystemUser);
my ($status, $msg) = $newgrp->_Create( Name => $groupname,
	Description => 'description here',
	Domain => 'UserDefined',
	Type => '', Instance => 0, );

-Jarno

-- 
Jarno Huuskonen




More information about the rt-users mailing list