[rt-users] Getting a list of privileged users...

Johnathan Bell johnathan.bell at baker.edu
Thu Nov 19 08:33:06 EST 2009


I'm running a script that grabs a list of users from our LDAP directory and synchronizes group memberships and permissions. Currently, I use code similar to this, to get a list of members:

--snip--
my $currentUser = GetCurrentUser();
my $workingUser = new RT::User($currentUser);
my $systemUser  = RT::User->new($RT::SystemUser);

    # RT Group
    $groupObj = new RT::Group($currentUser);
    $groupObj->LoadUserDefinedGroup($groupName);

    if ( not $groupObj->Id() )
    {
        print "Group ".$groupName." not found in RequestTracker\n";
        next;
    }

    # Get our members into an array for easy work later.
    $groupMembersObj = $groupObj->MembersObj();
    my @rtMembers;
    while ( $groupMember = $groupMembersObj->Next() )
    {
        $groupMemberUser = $groupMember->UserObj();
        $workingUser->Load($groupMember->MemberId());
        $workingUser->Name();
        push(@rtMembers, $workingUser->Name());
    }
--snip--

Basically, I load a group by name, and then loop through the array and grab each user into an array. Is there a way I can do this for privileged user names? I just want to get them into an array to work with them later.

Thanks,
Johnathan

--
Johnathan Bell
Internet System Administrator, Baker College

Office Phone: 810-766-4097
Office Hours: 7A-4P, M-F




More information about the rt-users mailing list