Documentation

GetUserGroupString

string
CUser::GetUserGroupString()

The method returns a string with comma-separated ID's of all groups containing the current authorized user (usually called from the $USER object). The data is retrieved from the session variable, which value corresponds to the user assignment at the moment of authorization. If the user is not authorized, "all users" group ID will be returned. Non-static method.

Parameters

No parameters.

See Also

Examples of use

<?
// obtain an array of groups for current user
global $USER;
$strGroups = $USER->GetUserGroupString();
echo $strGroups; // "1,2,3"
?>


© «Bitrix24», 2001-2024
Up