Sm_PolicyApi_RemoveUsersFromPolicy()
Disassociates the user identified by pszUserPolicyOid from the policy identified by pszPolicyOid. Only one user specification (which may be an aggregate) can be removed at a time.
sm1252sp1
Disassociates the user identified by
pszUserPolicyOid
from the policy identified by pszPolicyOid
. Only one user specification (which may be an aggregate) can be removed at a time.Type
User and user state function.
Syntax
int SM_EXTERN Sm_PolicyApi_RemoveUsersFromPolicy (void*pSessionHandle,const char*pszPolicyOid,const char*pszUserPolicyOid);
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. |
pszPolicyOid
| I | A null-terminated string containing the object identifier of an existing policy from which a user is to be removed. |
pszUserPolicyOid
| I | A null-terminated string containing the object identifier of an existing policy user. |
Remarks
This function is successful only when the pointer to Sm_PolicyApi_User_t isobtained with the Sm_PolicyApi_GetPolicyUsers() function. If theuseris retrieved with Sm_PolicyApi_LookupDirectoryEntry(), Sm_PolicyApi_GetDirectoryContents(), or Sm_PolicyApi_ValidateDirectoryEntry(),
pszUserPolicyOid
willbeinvalid and the call will fail.Returns
- Sm_PolicyApi_Success. The remove operation was successful.
- Sm_PolicyApi_Failure. The remove operation was not successful.
- Sm_PolicyApi_InvalidHandle. There was no valid initialization prior to this call.
- Sm_PolicyApi_NoSession. There is no valid administrator session.
- Sm_PolicyApi_NoPrivilege. The administrator does not have the privilege to remove a user from the policy.
- Sm_PolicyApi_InvalidOid:
- The policy OID was not found.
- The user policy OID was not found.