Utenti

Descrizione

Restituisce la raccolta di utenti associata al repository schema. Si tratta di una proprietà di sola lettura; è possibile visualizzarla, ma non impostarla.

Ogni elemento presente nella raccolta restituita è un Oggetto User.

Sintassi

VBScript

adminSession.Users 

Perl

$adminSession->GetUsers(); 
Identificativo
Descrizione
adminSession
L'oggetto AdminSession rappresenta la sessione di accesso corrente del repository schema.
Valore di ritorno
Un Oggetto Users contenente tutti gli utenti nel repository schema.

Esempio

VBScript

set adminSession = CreateObject("ClearQuest.AdminSession")
set Session = CreateObject("ClearQuest.Session")

adminSession.Logon "admin", "admin", ""

set userList = adminSession.Users

For each userObj in userList
  userName = userObj.Name
  SessionObj.OutputDebugString "Found user: " & userName
Next 

Perl

use CQPerlExt;

#Create a Rational ClearQuest admin session
$adminSession= CQAdminSession::Build();

#Logon as admin
$adminSession->Logon( "admin", "admin", "" );

#Get the list of users in the repository.
$userList = $adminSession->GetUsers();

#Get the number of users
$numUsers = $userList->Count();

#Iterate through the users
for ( $x=0; $x<$numUsers; $x++ ) {
     #Get the specified item in the collection of users
     $userObj = $userList->Item( $x );
     #Get the name of the user
     $userName = $userObj->GetName();
}

CQAdminSession::Unbuild($adminSession); 

Feedback