SYNOPSIS

  use RT::Groups;
  my $groups = $RT::Groups->new($CurrentUser);
  $groups->LimitToReal();
  while (my $group = $groups->Next()) {
     print $group->Id ." is a group id\n";
  }

DESCRIPTION

METHODS

LimitToSystemInternalGroups

Return only SystemInternal Groups, such as "privileged" "unprivileged" and "everyone"

LimitToUserDefined Groups

Return only UserDefined Groups

LimitToPersonalGroupsFor PRINCIPAL_ID

Return only Personal Groups for the user whose principal id is PRINCIPAL_ID

LimitToRolesForQueue QUEUE_ID

Limits the set of groups found to role groups for queue QUEUE_ID

LimitToRolesForTicket Ticket_ID

Limits the set of groups found to role groups for Ticket Ticket_ID

LimitToRolesForSystem System_ID

Limits the set of groups found to role groups for System System_ID

WithMember {PrincipalId => PRINCIPAL_ID, Recursively => undef}

Limits the set of groups returned to groups which have Principal PRINCIPAL_ID as a member =begin testing

my $u = RT::User->new($RT::SystemUser); $u->Create(Name => 'Membertests'); my $g = RT::Group->new($RT::SystemUser); my ($id, $msg) = $g->CreateUserDefinedGroup(Name => 'Membertests'); ok ($id,$msg);

my ($aid, $amsg) =$g->AddMember($u->id); ok ($aid, $amsg); ok($g->HasMember($u->PrincipalObj),"G has member u");

my $groups = RT::Groups->new($RT::SystemUser); $groups->LimitToUserDefinedGroups(); $groups->WithMember(PrincipalId => $u->id); ok ($groups->Count == 1,"found the 1 group - " . $groups->Count); ok ($groups->First->Id == $g->Id, "it's the right one");

LimitToEnabled

Only find items that haven\'t been disabled

LimitToDeleted

Only find items that have been deleted.