EssGetGroupList

Description

EssGetGroupList() gets the list of users who are members of a group (or the list of groups to which a user belongs).

Syntax
ESS_FUNC_M EssGetGroupList (hCtx, GroupName, pCount, ppUserList);
ESS_HCTX_ThCtx
ESS_STR_TGroupName
ESS_PUSHORT_TpCount
ESS_PPUSERNAME_TppUserList

Parameters

hCtxEssbase API context handle.
GroupNameUser name or group name.
pCountAddress of variable to receive count of user names.
ppUserListAddress of pointer to receive allocated array of user name strings.

Return Value

If successful, returns a count of user names in pCount, and a array of user name strings in ppUserList.

Notes

Access

This function requires the caller to have Create/Delete User privilege (ESS_PRIV_USERCREATE) for the logged in server, unless they are a user getting their own list of groups.

Example

ESS_FUNC_M
ESS_ListGroupUsers (ESS_HCTX_T  hCtx,
                    ESS_HINST_T hInst
                   )
{
   ESS_FUNC_M        sts = ESS_STS_NOERR;
   ESS_PUSERNAME_T  UserList = NULL;
   ESS_USHORT_T     ind;
   ESS_USHORT_T     Items;
   ESS_STR_T        GroupName;
   GroupName = "PowerUsers";
    sts = EssGetGroupList (hCtx, GroupName, &Items, &UserList); 
   if (!sts)
   {
      if (Items && UserList)
      {
         printf ("\r\n-------%s User List-------\r\n\r\n", GroupName);      
         for (ind = 0; ind < Items; ind++)
         {   
             if (UserList [ind]) 
                printf ("%s\r\n", UserList [ind]);
         }
         EssFree (hInst, UserList);
      }   
      else
         printf ("\r\nUsers list is empty\r\n\r\n");    
   }
       
   return (sts);
}

See Also

EssAddToGroup()
EssDeleteFromGroup()
EssListGroups()
EssSetGroupList()