# EssSetDatabaseAccess

Description

EssSetDatabaseAccess() sets a list of user database access structures, which contain information about user access to databases.

Syntax

    ESS_FUNC_M EssSetDatabaseAccess (hCtx, Count, pUserDb);

ESS_HCTX_T | hCtx
ESS_USHORT_T | Count
ESS_PUSERDB_T | pUserDb

Parameters

hCtx | Essbase API context handle.
Count | Count of user database structures.
pUserDb | Pointer to an array of user database structures.

Return Value

None.

Notes

- The Access field of the user database structure is used to set the user's granted access to the database. For this call the MaxAccess and FilterName fields are ignored.

Access

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

Example

    ESS_FUNC_M
    ESS_SetDatabaseAccess (ESS_HCTX_T  hCtx)
    {
       ESS_FUNC_M      sts = ESS_STS_NOERR;
       ESS_USHORT_T    Count;
       ESS_USERDB_T    UserDb[2];

       Count = 2;
      /* Initialize user database structure for user1 */
       strcpy(UserDb[0].UserName,"Newuser");
       strcpy(UserDb[0].AppName,"Sample");
       strcpy(UserDb[0].DbName,"Basic");
       UserDb[0].Access = ESS_PRIV_WRITE;

      /* Initialize user database structure for user2 */
       strcpy(UserDb[1].UserName,"Newuser2");
       strcpy(UserDb[1].AppName,"Sample");
       strcpy(UserDb[1].DbName,"Basic");
       UserDb[1].Access = ESS_PRIV_READ;
       sts = EssSetDatabaseAccess(hCtx, Count, UserDb);
       return (sts);
    }

See Also

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