UserGroupAdd
You can use the UserGroupAdd function to assign one or more groups to an Optiva user. This function adds users to security groups and grants them group-based permissions and access rights.
When to use
You can use this function to grant users access to group-specific resources.When not to use
You cannot use this function when access collection security is active.Syntax
int UserGroupAdd(string UserCode, string GroupsList)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| UserCode | string | Yes | The user code or username identifying the Optiva user to whom groups will be assigned. |
| GroupsList | string | Yes | A single group name or semicolon-separated list of group names to assign to the user. |
Return Value
The application returns a value greater than0 if the operation is successful.Otherwise, the operation fails.
Impact
The user gains the permissions associated with the assigned group or groups.Prerequisites
- The target user must exist in the system.
- The specified groups must exist in the system.
Examples
- Example 1
-
Assign a single group to a user.
UserGroupAdd("FSI", "ADMIN");
- Example 2
-
Assign multiple groups to a user.
UserGroupAdd("FSI", "ADMIN;CORE");