EssGetApplicationAccess

Description

EssGetApplicationAccess() gets a list of user application access structures, which contain information about user access to applications.

Syntax
ESS_FUNC_M EssGetApplicationAccess (hCtx, UserName, AppName, pCount, ppUserApp);
ESS_HCTX_ThCtx
ESS_STR_TUserName
ESS_STR_TAppName
ESS_PUSHORT_TpCount
ESS_PPUSERAPP_T ppUserApp

Parameters

hCtxEssbase API context handle.
UserNameUser name. If NULL, lists all users for the specified application.
AppNameApplication name. If NULL, lists all applications for the specified user.
pCountAddress of variable to receive count of user application structures.
ppUserAppAddress of pointer to receive an allocated array of user application structures.

Return Value

If successful, returns a count of users/applications in pCount, and a list of user application structures in ppUserApp.

Notes

Access

This function requires the caller to have Application Design privilege (ESS_PRIV_APPDESIGN) for the specified application, unless they are getting their own application access information.

Example

ESS_FUNC_M 
ESS_GetApplicationAccess (ESS_HCTX_T  hCtx, ESS_HINST_T hInst)
{
   ESS_FUNC_M       sts = ESS_STS_NOERR;
   ESS_STR_T       UserName;
   ESS_STR_T       AppName;
   ESS_USHORT_T    Count = 0;
   ESS_USHORT_T    ind;
   ESS_PUSERAPP_T  UserApp = NULL;   
   
   UserName = "Admin";
   AppName  = "";
   
   sts = EssGetApplicationAccess(hCtx, UserName,
         AppName, &Count, &UserApp);
   if(!sts)
   {
      if(Count && UserApp)
      {  
         printf ("\n------Application Access List----\n\n");    
         for (ind = 0; ind < Count; ind++)
         {
         printf ("User->%s Application->%-10s 
                  Access->%-4d MaxAccess->%-6d\r\n",
                  UserApp[ind].UserName,  
                  UserApp[ind].AppName, 
                  UserApp[ind].Access,
                  UserApp[ind].MaxAccess);
         }
         EssFree (hInst, UserApp);        
      }
      else
         printf ("\rUser Application list is empty\n\n");    
   }    
   return (sts);
}

See Also

EssGetDatabaseAccess()
EssListUsers()
EssSetApplicationAccess()
EssSetUser()