question

andersen avatar image
andersen asked

Catalog/GetDraftItem: You do not have permission to modify these items

Hello, I'm facing a permissions issue when trying to get a draft item that is from another entity (player).

I'm using Groups to easily "link" content that can be shared between different entities (players) but I'm only able to get success callbacks on the PlayFabEconomyAPI.GetDraftItem() when I request content from the owner session, if I as a member of the group request the draft item linked in the group I got the error:

"/Catalog/GetDraftItem: You do not have permission to modify these items."

Questions:

  1. How could I add some policy for read/write access to the draft item?

  2. What could be the proper way to link a draft item between multiple accounts so that any of the accounts can edit the draft item?

Shared Group Data
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
kylemc@microsoft.com avatar image
kylemc@microsoft.com answered

A Title entity can access any Draft Item. I'd recommend creating a CloudScript function that.

  1. Checks is a user is in a group

  2. If so, call the API as a Title Entity

  3. Returns the draft item to the caller

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

andersen avatar image andersen commented ·

I already using PlayFabGroupsAPI.ListMembership() to get all the groups an entity is a part of. I will request the draft item using the Title entity. Thank you.

0 Likes 0 ·
andersen avatar image andersen commented ·

Hello, I still trying to do this the right way but is not working. Could you share some specific links to the documentation (I already searched but didn't find one for my case) or an example code? I tried using Revisions (legacy) and Functions.

0 Likes 0 ·
Neils Shi avatar image Neils Shi andersen commented ·

Since Legacy CloudScript no longer adds new features, you may not be able to use Economy V2 on legacy CloudScript. If you want to implement function with Economy V2 on server-side, we recommend you use CloudScript using Azure Functions instead. For more info, please refer to Writing a PlayFab CloudScript using Azure Functions. To check if a player is in a group, you can use the API IsMember. If so, then he can use API GetDraftItem/ UpdateDraftItem to get/modify the draft item via TitleAuthenticationContext.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.