Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # RT working vars
- my $groupObj = new RT::Group($currentUser);
- my $queueObj = new RT::Queue($currentUser);
- # Load our RT queue (use one of the two indented snippets here)
- # For "Global" permissions, put $RT::System in the queue object.
- ($status, $msg) = $queueObj = $RT::System;
- $status or die("Error loading \$RT::System: ".$msg."\n");
- # For semi-global permissions, you can use "General" for the queue name if you're not going global
- ($status, $msg) = $queueObj->Load($queueName);
- $status or die("Error loading RT queue \"$queueName\"");
- # Load the system internal group (use "everyone" for $groupname)
- ($status, $msg) = $groupObj->LoadSystemInternalGroup($groupName);
- $status or die("Error loading RT System group \"$groupName\"\nInput File line $line:\n> $_\n\nRT Error: ".$msg."\n");
- # Actually grant the right (Use "ReplyToTicket" or whatever for "$rightName"
- # And use "RevokeRight" if you want to revoke instead of grant)
- ($status, $msg) = $groupObj->PrincipalObj->GrantRight(
- Right => $rightName,
- Object => $queueObj);
- print $status ? "Granting right \"$rightName\" to group \"$groupName\" on queue \"$queueName\"\n"
- : "Group \"$groupName\" on queue \"$queueName\" already had right \"$rightName\"\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement