[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rt-users
Subject:    Re: [rt-users] How to set Global rights in Perl? (How do I get
From:       Kevin Falcone <falcone () bestpractical ! com>
Date:       2009-12-30 20:25:36
Message-ID: 20091230202536.GD3556 () jibsheet ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Wed, Dec 30, 2009 at 10:47:08AM -0500, Johnathan Bell wrote:
> I've written a script that will process an ACL-like file and set a number of \
> permissions on our RT server, but currently I have this only working for specific \
> queues. How can I make this work for global rights? Currently, I have it working as \
> such: 
> --snip--
> # $groupName and $queueName are specified in the function parameters. Assume \
> they're correct. # $status and $msg are also defined globals.
> my $groupObj = new RT::Group($currentUser);
> my $queueObj = new RT::Queue($currentUser);
> 
> # Load our RT queue
> ($status, $msg) = $queueObj->Load($queueName);
> 
> # Do one of these based on the type of group:
> ($status, $msg) = $groupObj->LoadUserDefinedGroup($groupName);
> ($status, $msg) = $groupObj->LoadQueueRoleGroup(Queue => $queueObj->id, Type => \
> $groupName); ($status, $msg) = $groupObj->LoadSystemInternalGroup($groupName);
> 
> ($status, $msg) = $groupObj->PrincipalObj->GrantRight(
> Right => $rightName,
> Object => $queueObj);
> --snip--
> 
> I know that GrantRight takes a string "RightName" and an object to apply the right \
> to and for. Can I use the same "$groupObj->PrinciplaObj->GrantRight("RightName", \
> $object) to specify global rights? How do I get "global" into an object?

You probably want the $RT::System object

-kevin


[Attachment #5 (application/pgp-signature)]

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic