How to set Global rights in Perl? (How do I get "global" into an object)

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?
Johnathan Bell
Internet System Administrator, Baker College

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

Hello,

I am new to RT, have the O’Reilly book and been reading the wiki. We are
using RT as a clearinghouse for people who want to volunteer on certain
projects. I’ve set it so that volunteers can enroll themselves in groups
according to what type of work they want to do, and setting group dashboards
that show tickets in the appropriate queues.

Since each project will be broken down into individual tasks, I don’t want
people spammed with a notice of each ticket, only that there has been at
least one ticket entered since the last check. Is there something like
TransactionBatch that I can use?

Thanks!

Steven Cochran

a) Don’t make them AdminCCs and send an explicit message when a new
project is input
B) set the user accounts to receive digests
c) use a CF to set a flag against notification. Doing so in a variant
of the bulleted list to sub-ticket scrip on the wiki could provide a
nice system

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


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

Kevin–That’s exactly what I needed. Thanks.

Johnathan Bell
Internet System Administrator, Baker College

Office Hours: 7A-4P, M-F