# EssSetCalcList

Description

EssSetCalcList() sets the list of calc scripts objects which are accessible to a user.

Syntax

    ESS_FUNC_M  EssSetCalcList (hCtx, UserName, AppName, DbName, AllCalcs, Count, pCalcList);

ESS_HCTX_T | hCtx
ESS_STR_T | UserName
ESS_STR_T | AppName
ESS_STR_T | DbName
ESS_BOOL_T | AllCalcs
ESS_USHORT_T | Count
ESS_POBJNAME_T | pCalcList

Parameters

hCtx | Essbase API context handle
UserName | User name
AppName | Application name
DbName | Database name. If NULL, uses Application subdirectory
AllCalcs | Allow all calcs flag. If TRUE, the user can access all calc scripts, otherwise, they can only access those specified in the CalcList argument.
Count | Count of the number of accessible calc script objects
pCalcList | Pointer to an array of calc script object names

Return Value

None.

Notes

- If the AllCalcs flag is set to TRUE, the Count and pCalcList arguments will be ignored.
- In order to access any calc script objects, the user must have at least calculate access to the appropriate database.

Access

This function requires the caller to have database Design privilege (ESS_PRIV_DBDESIGN) for the specified database.

Example

    ESS_FUNC_M
    ESS_SetCalcList (ESS_HCTX_T  hCtx)
    {
       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;
       ESS_OBJNAME_T   pCalcList[3];

       UserName = "Newuser";
       AppName  = "Sample";
       DbName   = "Basic";
       AllCalcs = ESS_FALSE ;
       Count = 3;
       strcpy(pCalcList[0],"test1");
       strcpy(pCalcList[1],"test2");
       strcpy(pCalcList[2],"test3");

       sts = EssSetCalcList(hCtx, UserName, AppName,
             DbName, AllCalcs, Count, pCalcList);

       return (sts);
    }

See Also

EssGetCalcList()
EssListObjects()
EssListUsers()