question

Jesus Nieves avatar image
Jesus Nieves asked

Port error

Hi,

I'm trying to use entity objects to store player data like in https://docs.microsoft.com/en-us/gaming/playfab/features/data/entities/entity-objects

I only have 1 data in data dictionary that it's a string json from a list of integers (I tried with a simple integer too). When I call to PlayFabDataAPI.SetObjects, it always returns:

"The claim was not allowed to perform the requested action based on the entity's access policy. Policy comment: By default, all requests are denied. If you expected this request to succeed, you may be missing a policy. See the permissions APIs in PlayFab's Admin Api to add a permission. "

I'm using entityId and entityType obtained from PlayFabAuthenticationAPI.GetEntityToken. I can use them for matchmaking with no problems.

What could be wrong? I have to do anything else?

Any help is welcome.

Player Dataentities
1 comment
10 |1200

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

Jesus Nieves avatar image Jesus Nieves commented ·

Sorry, the title is wrong (I've recovered a draft and I've forgotten to change the title). I'm trying to change it but I don't know how I can do it.

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Could you please clarify, have you changed your Title’s default Entity Global Policy before? You can navigate to your Title’s [Game Manger]->[Title Settings]->[API feature] page or call the Admin API - GetGlobalPolicy to check it. For clarification, your Entity Global Policy at least needs to contain the following content, so that all entities under your Title can access their own entity profiles contains Entity Objects. If your Entity Global Policy misses the following content, you can try to add it to your Entity Global Policy, then try your logic again.

{
      "Action": "*",
      "Effect": "Allow",
      "Resource": "pfrn:data--*![SELF]/Profile/*",
      "Principal": "[SELF]",
      "Comment": "The default allow profile self access",
      "Condition": null
    }
2 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.

Jesus Nieves avatar image Jesus Nieves commented ·

@Sarah Zhang Thank you for your reply.

I haven't changed my default Entity Global Policy and it has that policy.

It also has 4 policies that deny write access for user and groups statistics like this:

{

"Action": "Write",

"Effect": "Deny",

"Resource": "pfrn:data--*!*/Profile/Statistics/*",

"Principal": "*",

"Comment": "Only title can edit user statistics",

"Condition": { "CallingEntityType": "title_player_account" }

}

I suppose they are default policies, I don't remember changing them.

I change user statistics using a cloud script.

After successful login, I get an entity token using PlayFabAuthenticationAPI.GetEntityToken.

After successful register, I can change "DisplayName" in player profile but I don't use entityId for that.

I use entityId for matchmaking and it works fine.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Jesus Nieves commented ·

Could you please provide your TitleId for our reference?

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.