At Monday 6/19/2006 03:46 PM, Bill Chever wrote:
Steve,
Thanks, but "so you'll have to work with that object to pull out the
individual requestors." is exactly what I am having trouble tracking down.
How do I "work with the Group object" and where would it be documented as to
what objects are actually available to me?
Thanks for the answer!
Bill
You can see the perl API docs with perldoc - assuming the $RTHOME/lib
directory is in your perl library path, do:
perldoc RT::Ticket_Overlay
to see the methods in the Ticket object.
This should get you the Group's members in an RT::GroupMembers
collection object:
my $requestors = $self->TicketObj->Requestors->MembersObj
Then to work with each requestor,
while (my $req = $requestors->Next) {
my $req_principal = $req->MemberObj;
if ($req_principal->IsUser) {
$req_principal->Object->SetPrivileged(0);
}
}
The variables above represent these kind of objects:
$requestors - RT::GroupMembers
$req - RT::GroupMember
$req_principal - RT::Principal
This seems cumbersome, and maybe there's a more streamlined way, but
it should do what you want. The if statement may be unnecessary ( I
think requestors are always users, not groups) but it doesn't hurt.
Steve
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com
We're hiring! Come hack Perl for Best Practical:
http://bestpractical.com/about/jobs.html