addArea()

Adds an area to the user management.

Synopsis

public bool addArea(shared_ptr<UserManagementArea> area) synchronized (instance);

Parameter Description
area The area that is added to the WinCC OA user management.

Return Value

The methods returns TRUE if an area 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)
{
  mapping areaData = makeMapping();
  shared_ptr<UserManagement> userMgm = UserManagement::getInstance();
  shared_ptr<UserManagementArea> area = new UserManagementArea("area3",areaData);
  DebugN(userMgm.addArea(area)); /*Added the area3 to the user management */
  DebugN(userMgm.saveChanges());
  dyn_anytype areaInfo = userMgm.getAllAreas();
  DebugN("All areas:", areaInfo);
}

EXAMPLE

main(mapping event)
{
  unsigned level =2;
  int i;
  for (i=0; i<level; i++)
  getUserPermissionForArea(uPerm, level,"area3", "WinCCOAOperator");
  /* does the user WinCCOAOperator have the bits 1 and 2 required for the area3 */
}

Assignment

User administration

See also

getArea(), getAllAreas()