saveChanges()
The method saves the changes such as add or remove to the _Users data point.
Synopsis
public bool saveChanges();
Return Value
The method returns TRUE if the changes could be saved.
Errors
Errors are shown in the log viewer.
EXAMPLE
#uses "classes/userManagement/UserManagement"
main(mapping event)
{
mapping grData = makeMapping();
shared_ptr<UserManagement> userMgm = UserManagement::getInstance();
shared_ptr<UserManagementGroup> userGroup;
userGroup = userMgm.getGroupByName("operatorAll");
if (userGroup != nullptr)
{
DebugN("Remove group:", userMgm.remove(userGroup));
/* Deletes the group operatorAll */
userMgm.saveChanges();
/* Saves the changes */
}
else
DebugN("Group not found");
dyn_anytype allGroups = userMgm.getAllGroups();
for (int i =1; i<=dynlen(allGroups); i++)
{
DebugN("Groups:", allGroups[i].getName());
}
}
Assignment
See also