General Introduction
Settings
Add
Authorize
CanDoFileOperation
ChangePassword
Delete
GetByID
GetByLogin
GetCount
GetEmail
GetExternalAuthList
GetFirstName
GetFullName
GetID
GetLastName
GetList
GetLogin
GetParam
GetPasswordHash
GetUserGroup
GetUserGroupArray
GetUserGroupList
GetUserGroupString
IsAdmin
IsAuthorized
IsOnLine
Login
LoginByHash
Logout
Register
SavePasswordHash
SendPassword
SendUserInfo
SetLastActivityDate
SetParam
SetUserGroup
SetUserGroupArray
SimpleRegister
Update
Complex logic in filter
Special variables
Special constants
SetUserGroupArray
CUser::SetUserGroupArray( array groups );
The method assigns the current user to a number of groups (usually called on the $USER object). The data is retrieved from session variable, which value corresponds to the user assignment at the moment of authorization. This assignment to groups is not stored in the database and will not be restored upon further authorizations. To store the assignment in the database, use the method CUser::SetUserGroup. Non-static method.
Parameters
Parameter | Description |
---|---|
groups | Array with user groups IDs. |
See Also
Examples of use
<? // assign the current user to a group with ID=5 global $USER; $arGroups = $USER->GetUserGroupArray(); $arGroups[] = 5; $USER->SetUserGroupArray($arGroups); ?>
© «Bitrix24», 2001-2023
Up