Gets the list of calc scripts objects which are accessible to a user.
Syntax
ESS_FUNC_M EssGetCalcList (hCtx, UserName, AppName, DbName, pAllCalcs, pCount, ppCalcList);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle |
UserName | ESS_STR_T | User name |
AppName | ESS_STR_T | Application name |
DbName | ESS_STR_T | Database name |
pAllCalcs | ESS_PBOOL_T | Address of a variable to receive the allow all calcs flag. If TRUE, the user can access all calc scripts, otherwise, they can only access those specified in the CalcList argument. |
pCount | ESS_PUSHORT_T | Address of variable to receive a count of the number of accessible calc script objects |
ppCalcList | ESS_PPOBJNAME_T | Address of a pointer to receive an allocated array of calc script object names |
Notes
In order to access any calc script objects, the specified user must have at least calculate access to the appropriate database.
If the pAllCalcs flag is set to TRUE, pCount is zero, and ppCalcList is NULL.
The memory allocated for ppCalcList should be freed using EssFree().
Return Value
If successful, the user's allow all calcs setting is returned in pAllCalcs, a count of their accessible calc scripts objects is returned in pCount, and a list of calc script object names is returned in ppCalcList.
Access
This function requires the caller to have database Design privilege (ESS_PRIV_DBDESIGN) for the specified database, unless they are getting their own calc list.
Example
ESS_FUNC_M ESS_GetCalcList (ESS_HCTX_T hCtx, ESS_HINST_T hInst) { ESS_FUNC_M sts = ESS_STS_NOERR; ESS_STR_T UserName; ESS_STR_T AppName; ESS_STR_T DbName; ESS_BOOL_T AllCalcs; ESS_USHORT_T Count, ind; ESS_POBJNAME_T pCalcList = NULL; UserName = "Admin"; AppName = "Sample"; DbName = "Basic"; sts = EssGetCalcList(hCtx, UserName, AppName, DbName, &AllCalcs, &Count, &pCalcList); if(!sts && pCalcList) { printf("-------- Get Calc List -----------\r\n"); for (ind = 0; ind < Count; ind ++) printf(" %s\r\n",pCalcList[ind]); EssFree(hInst, pCalcList); } return (sts); }
See Also