Method HIUGCGrantOrRevokePermissions
HIUGCGrantOrRevokePermissions(String, String, String, String, Permission)
Grants or revokes permissions for a player in relation to an in-game asset.
Declaration
public System.Threading.Tasks.Task<Den.Dev.Grunt.Models.HaloApiResultContainer<Den.Dev.Grunt.Models.HaloInfinite.Permission,Den.Dev.Grunt.Models.RawResponseContainer>> HIUGCGrantOrRevokePermissions (string title, string assetType, string assetId, string player, Den.Dev.Grunt.Models.HaloInfinite.Permission permission);
Parameters
Type | Name | Description |
---|---|---|
System.String | title | Title associated with an asset. Example value is "hi" for Halo Infinite. |
System.String | assetType | Type of asset to modify permissions for. Example value is "ugcGameVariants". |
System.String | assetId | Unique asset ID. Example value is "3895f3d4-2493-4b84-ae18-876ad3ab344d" for a UGC game variant. |
System.String | player | The unique player XUID, in the format "xuid(XUID_VALUE)". |
Permission | permission | A Permission object with the AuthoringRole set to the desired permission level. Ensure that no other properties other than AuthoringRole are set. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<HaloApiResultContainer<Permission,RawResponseContainer>> | If successful, returns an instance of Permission with permission details. Otherwise, returns a null result object with attached error details. |
Examples
Here is an example response from the API, as snapshotted on 11/8/2022:
{
"CanonicalToken": "xuid(PLAYER_XUID_HERE)",
"AuthoringRole": 1,
"GrantedBy": "xuid(PLAYER_XUID_HERE)",
"GrantedOnDateUtc": {
"ISO8601Date": "2022-11-08T23:43:04.975Z"
}
}
To use this function in your code:
Permission permission = new()
{
AuthoringRole = 1
};
var result = (await client.HIUGCGrantOrRevokePermissions("hi", "ugcGameVariants", "3895f3d4-2493-4b84-ae18-876ad3ab344d", "xuid(YOUR_XUID)", permission));