DRMAddRightWithUser
TOC
Collapse the table of content
Expand the table of content

DRMAddRightWithUser function

[The AD RMS SDK leveraging functionality exposed by the client in Msdrm.dll is available for use in Windows Server 2008, Windows Vista, Windows Server 2008 R2, Windows 7, Windows Server 2012, and Windows 8. It may be altered or unavailable in subsequent versions. Instead, use Active Directory Rights Management Services SDK 2.1, which leverages functionality exposed by the client in Msipc.dll.]

The DRMAddRightWithUser function assigns a right to a user in an issuance license.

Syntax


HRESULT DRMAddRightWithUser(
  _In_ DRMPUBHANDLE hIssuanceLicense,
  _In_ DRMPUBHANDLE hRight,
  _In_ DRMPUBHANDLE hUser
);

Parameters

hIssuanceLicense [in]

The handle of the issuance license to add the right to. This handle is obtained by using the DRMCreateIssuanceLicense function.

hRight [in]

The handle of the right to add to the issuance license. This handle is obtained by using the DRMCreateRight function.

hUser [in]

The handle of the user to apply the right to. This handle is obtained by using the DRMCreateUser function.

Return value

If the function succeeds, the function returns S_OK.

If the function fails, it returns an HRESULT value that indicates the error. Possible values include, but are not limited to, those in the following list. For a list of common error codes, see Common HRESULT Values.

E_DRM_ID_MISMATCH

The IDs do not match.

Remarks

Because there is no way to remove a particular user right (to remove all user rights, use the DRMClearAllRights function), we recommend that you collect all user and right information first, and then bind users to rights after all changes have been made.

All rights added must be specifically recognized and handled by the application. An application is not required to handle any standard XrML rights except EDIT. If a user is allowed to edit the content in any way (for example, a user is granted a custom "ADDCOMMENT" right), the user must also be granted the standard XrML EDIT right.

Requirements

Product

Rights Management Services client 1.0 SP2 or later

Header

Msdrm.h

Library

Msdrm.lib

DLL

Msdrm.dll

See also

AD RMS Functions
Creating and Using Issuance Licenses
DRMCreateIssuanceLicense
DRMCreateRight
DRMCreateUser

 

 

Show:
© 2016 Microsoft