Share via


I_IrmPolicyInfo.GetRequestingUser Method

Applies to: SharePoint Foundation 2010

Gets the email address of the user requesting this file.

HRESULT HrGetRequestingUser(
    BSTR*  pbstrRequestingUser,
    BOOL*  pfRequestingUserIsSystem
    );

Parameters

pbstrRequestingUser

[out] The email address of the user requesting this file.

pfRequestingUserIsSystem

[out] True if SharePoint Foundation itself is requesting the file. False if any other user is requesting the file.

Return Value

All I_IrmPolicyInfo Class methods return HRESULT values. A positive OK value indicates the operation was successful. A negative return value indicates that the function did not succeed.

In general, if an I_IrmPolicyInfo Class method fails, the protector will not be able to recover from the error and will fail as well.

Remarks

This method enables the I_IrmProtector.HrProtect Method method of an autonomous Information Rights Management (IRM) protector to determine the email address of the user who is requesting the file.

The protector should associate the user email address with the rights granted to the user in the I_IrmPolicyInfo.HrGetRightsMask Method method. The protector can use the email address to help identify the requesting user. An IRM-aware client application can use the rights mask to authorize specific requests from the user.

The pfRequestingUserIsSytem argument specifies if SharePoint Foundation itself is requesting the file, thereby enabling the protector to alter its behavior if that is the case. Since it is typical to automatically add SharePoint Foundation as an owner of the document, this argument can be used to prevent a protector from adding SharePoint Foundation twice.

For more information about integrated and autonomous protectors, see Custom IRM Protectors.

See Also

Reference

I_IrmProtector Interface

I_IrmPolicyInfo Class

Concepts

Information Rights Management in SharePoint Foundation

Custom IRM Protectors