[rt-users] Creating Group and giving Rights.

JJussi rt-users at jjussi.com
Mon Feb 1 03:08:35 EST 2010


On Monday, 1. Februaryta 2010 08:31:27 Jarno Huuskonen wrote:



> Hi,
> 
> > On Friday, 29. January 2010 13:15:37 JJussi wrote:
> > 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?
> 
> What are you trying to achieve ? Are you trying to give the new group
> permissions to some queueu ?

Situation, where queue have group-rights.
So, at ACL -table we get one line per every right..
*principaltype = "Group"
*principalid = Groups-id
*rightname = ... ReplyToTicket
*objecttype = "RT:Queue"
*objectid = ...




> 
> 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.

-- 
JJussi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100201/330804ee/attachment.htm>


More information about the rt-users mailing list