Checks whether a user has a specified privilege.
public:
static IAsyncOperation<PrivilegeCheckResult>^ CheckPrivilegeAsync(
IUser^ user,
uint32 privilegeId,
bool attemptResolution,
String^ friendlyDisplay
)
user
Type: IUser
The user to check privileges for.
privilegeId
Type: uint32
The privilege to check. 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.
Type: IAsyncOperation<PrivilegeCheckResult>
An interface for tracking the progress of the asynchronous call. The result indicates the result of the privilege check.
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.
You can't %1 because of how your account is set up. Your parent can change this for you in your privacy settings.
Using the previous example, this would display the following string on the user’s console:
You can't play XboxTitle multiplayer because of how your account is set up. Your parent can change this for you in your privacy settings.
If a user has an Xbox Live Silver account and a check against XPRIVILEGE_MULTIPLAYER_SESSIONS is performed, then the Xbox Live Gold upsell flow will be triggered.
Namespace: Windows.Xbox.ApplicationModel.Store
Metadata: windows.winmd