getGroup()
The method returns a group.
Synopsis
public shared_ptr<UserManagementGroup> getGroup(long id) synchronized (instance);
Parameter | Description |
---|---|
id | The group ID - see example below. |
Return Value
A group.
Errors
Errors are shown in the log viewer.
EXAMPLE
#uses "classes/userManagement/UserManagement"
main(mapping event)
{
shared_ptr<UserManagement> userMgm = UserManagement::getInstance();
shared_ptr<UserManagementGroup> GroupData;
dyn_anytype allGroups = userMgm.getAllGroups();
/* Returns all groups and outputs the name of the group and the ID */
for (int i =1; i<=dynlen(allGroups); i++)
{
GroupData = userMgm.getGroup(allGroups[i].getId());
DebugN("Groups:", GroupData.getName(),GroupData.getId() );
}
}
Assignment
See also
getGroupByName(), getGroupByOSID(), getGroupsByAreaId(), getGroupsByUser()