$req_principal->Object->PrincipalObj->SetDisabled(1);

When You revoke "Let this user access RT" in effect you are disabling the user's
principal object.



Quoting Bill Chever <[EMAIL PROTECTED]>:

Alrighty then!

This is great information, Stephen.  Thanks!

Only one problem - The right I want to revoke is the "Let this user access
RT" right, not "Let this user be granted rights" which is what gets changed
by the SetPrivileged.  Is there a SetAccess equivalent?

Bill
-----Original Message-----
From: Stephen Turner [mailto:[EMAIL PROTECTED]
Sent: Monday, June 19, 2006 1:29 PM
To: Bill Chever
Cc: [email protected]
Subject: RE: [rt-users] Set user rights with scrip?

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



_______________________________________________
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

Reply via email to