Advertisement
Guest User

Untitled

a guest
Apr 15th, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.34 KB | None | 0 0
  1.     # RT working vars
  2.     my $groupObj = new RT::Group($currentUser);
  3.     my $queueObj = new RT::Queue($currentUser);
  4.  
  5.     # Load our RT queue (use one of the two indented snippets here)
  6.         # For "Global" permissions, put $RT::System in the queue object.  
  7.         ($status, $msg) = $queueObj = $RT::System;
  8.         $status or die("Error loading \$RT::System: ".$msg."\n");
  9.        
  10.         # For semi-global permissions, you can use "General" for the queue name if you're not going global
  11.         ($status, $msg) = $queueObj->Load($queueName);
  12.         $status or die("Error loading RT queue \"$queueName\"");
  13.  
  14.     # Load the system internal group (use "everyone" for $groupname)
  15.         ($status, $msg) = $groupObj->LoadSystemInternalGroup($groupName);
  16.         $status or die("Error loading RT System group \"$groupName\"\nInput File line $line:\n> $_\n\nRT Error: ".$msg."\n");
  17.  
  18.     # Actually grant the right (Use "ReplyToTicket" or whatever for "$rightName"
  19.     # And use "RevokeRight" if you want to revoke instead of grant)
  20.     ($status, $msg) = $groupObj->PrincipalObj->GrantRight(
  21.         Right => $rightName,
  22.         Object => $queueObj);
  23.  
  24.     print $status ? "Granting right \"$rightName\" to group \"$groupName\" on queue \"$queueName\"\n"
  25.         : "Group \"$groupName\" on queue \"$queueName\" already had right \"$rightName\"\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement