addGroup()
Adds a group to the user management.
Synopsis
public bool addGroup(shared_ptr<UserManagementGroup> group) synchronized (instance);
Parameter | Description |
---|---|
group | The user group that is added to the WinCC OA user management. |
Return Value
The methods returns TRUE if a group could be added to the user management.
Errors
Errors are shown in the log viewer.
The rights of an area are not checked in WinCC OA automatically. You have to call the function getUserPermissionForArea() to check the rights.
EXAMPLE
#uses "classes/userManagement/UserManagement"
main(mapping event)
{
shared_ptr<UserManagement> userMgm = UserManagement::getInstance();
shared_ptr<UserManagementGroup> userGroup = new UserManagementGroup("WinCCOAManager");
DebugN("Added group:", userMgm.addGroup(userGroup)); /*Adds the group WinCCOAManager to the user management */
DebugN("Save changes:",userMgm.saveChanges());
DebugN("Groups:",userMgm.getAllGroups());
}
Assignment
See also