Product.CheckPrivilegesAsync Method

Checks whether a user has a specified list of privileges.

Syntax

public:
static IAsyncOperation<PrivilegeCheckResult>^ CheckPrivilegesAsync(
         IUser^ user,
         IVectorView<uint32>^ privilegeIds,
         bool attemptResolution,
         String^ friendlyDisplay
)  

Parameters

user
Type: IUser 

The user to check privileges for.

privilegeIds
Type: IVectorView<uint32> 

  The privilege IDs to check for. Supported privileges are listed in KnownPrivileges.

attemptResolution
Type: bool 

  Boolean indicating whether to allow the system to attempt to acquire the privilege for the user. When true, the system may prompt the user to upgrade to gold level.

friendlyDisplay
Type: String 

This value is not used anymore. See the remarks section below for detailed information on default strings.

Return value

Type: IAsyncOperation<PrivilegeCheckResult

An interface for tracking the progress of the asynchronous call. The result indicates the result of the privilege check.

Remarks

Important Before calling this method, verify that the user is signed in by checking the IUser.IsSignedIn Property. Calling this method for a user that is not signed in will throw exceptions. Note that the exeption will be thrown on task creation as opposed to task execution.
If the user is banned or parentally controlled, Xbox One will display a system message that notifies the user accordingly.

  • In the case of a user being banned, Xbox One uses the following base string:
    Because of your past behavior, you can't %1.  
    

    You may choose to provide a substring by passing in a value for friendlyDisplay, such as “play XboxTitle multiplayer”. This would display the following string on the user’s console:

    Because of your past behavior, you can't play XboxTitle multiplayer.  
    

Requirements

Namespace: Windows.Xbox.ApplicationModel.Store

Metadata: windows.winmd

See also

Reference

Product Class

Product Members

Windows.Xbox.ApplicationModel.Store Namespace