Script functions reference > Script functions in alphabetical order > G > GetRolesForUser

GetRolesForUser
Syntax
GetRolesForUser(user_name, directory, roles_var);
user_name
directory
0 = internal directory, 1 = external directory
roles_var
The variable that will contain the returned values. If you specify $<roles_variable>[0], all roles are returned (if your counter starts on 0, see example below). If you specify $<roles_variable>, only the first role is returned.
Description
Returns the roles associated with a user.
Returns
An array with the roles associated with a user. If the argument roles_var is a string, only the first role is returned.
Example
$roles[0] = "";
$cnt = getRolesForUser("dcool",0,$roles[0]);
$a = 0;
while ( num($a) < num($cnt) )
{
    Log( 0, "Roll : " + $roles[num($a)] );
    $a++;
}
OpenText StreamServe 5.6 Updated: 2013-03-01