Sm_PolicyApi_GetUserGroups()
Gets the list of groups that a user is member of.
casso127
Gets the list of groups that a user is member of.
Type
User and user state function.
Syntax
int SM_EXTERN Sm_PolicyApi_GetUserGroups (void *pSessionHandle,const char *pszUserDirOid,const char *pszUserDN,const bool bRecursive,char** pszGroups[]);
Parameter | I/O | Description |
pSessionHandle
| I | A pointer to an internal Policy Management API data structure. The structure holds information about the administrator session and the client session. |
pszUserDirOid
| I | The user's object identifier. |
pszUserDN
| I | The user's distinguished name. |
bRecursive
| I | Value indicating whether to search just one level or all levels. If you specify True, all levels are searched. |
pszGroups
| O | Array that will contain the groups that the user belongs to. Free the memory allocated for the array by calling Sm_PolicyApi_FreeStringArray(). |
Returns
- Sm_PolicyApi_Success. The get operation was successful.
- Sm_PolicyApi_Failure. The get operation was not successful.
- Sm_PolicyApi_Invalid. There was no valid directory for the specified user OID and DN.
- Sm_PolicyApi_InvalidHandle. There was no valid initialization prior to this call.
- Sm_PolicyApi_InvalidOid. The directory OID was not found (for a directory-based group).
- Sm_PolicyApi_NoSession. There is no valid administrator session.
- Sm_PolicyApi_NoPrivilege. The administrator does not have the privilege to get the groups.