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);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. |
UserName | ESS_STR_T | User name. If NULL, lists all users for the specified application. |
AppName | ESS_STR_T | Application name. If NULL, lists all applications for the specified user. |
pCount | ESS_PUSHORT_T | Address of variable to receive count of user application structures. |
ppUserApp | ESS_USERAPP_T, ESS_GROUPAPP_T | Address of pointer to receive an allocated array of user application structures. |
Notes
If UserName is NULL, all users will be listed for the specified application. If AppName is NULL, all applications will be listed for the specified user. However, UserName and AppName cannot both be NULL
The Access field of the user application structure is used to represent the user's granted access to the application, whereas the MaxAccess field represents the user's highest access from all sources (e.g. via groups or default application access etc.).
The memory allocated for ppUserApp should be freed using EssFree().
Return Value
If successful, returns a count of users/applications in pCount, and a list of user application structures in ppUserApp.
Access
This function requires callers to have application designer 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