Hey,
I am trying to get entities from one account and upload it to another.
i am using two different entity tokens, and my error is -
"The claim was not allowed to perform the requested action based on the entity's access policy."
this is my policy:
[ { "Action": "*", "Effect": "Allow", "Resource": "*--*", "Principal": { "ChildOf": { "EntityType": "namespace", "EntityId": "E1C86539AD904942" } }, "Comment": "The default allow title in namespace full access", "Condition": { "CallingEntityType": "title" } }, { "Action": "*", "Effect": "Allow", "Resource": "pfrn:data--*![SELF]/Profile/*", "Principal": "[SELF]", "Comment": "The default allow profile self access", "Condition": null }, { "Action": "*", "Effect": "Allow", "Resource": "pfrn:data--*![SELF]/Profile/*", "Principal": { "ChildOf": { "EntityType": "[SELF]" } }, "Comment": "The default allow profile child access", "Condition": null }, { "Action": "Write", "Effect": "Deny", "Resource": "pfrn:data--*!*/Profile/Statistics/*", "Principal": "*", "Comment": "Only title can edit user statistics", "Condition": { "CallingEntityType": "title_player_account" } }, { "Action": "Write", "Effect": "Deny", "Resource": "pfrn:data--*!*/Profile/Statistics/*", "Principal": "*", "Comment": "Only title can edit user statistics", "Condition": { "CallingEntityType": "character" } }, { "Action": "Write", "Effect": "Deny", "Resource": "pfrn:data--*!*/Profile/Statistics/*", "Principal": "*", "Comment": "Only title can edit user statistics", "Condition": { "CallingEntityType": "master_player_account" } }, { "Action": "Write", "Effect": "Deny", "Resource": "pfrn:data--group!*/Profile/Statistics/*", "Principal": { "MemberOf": { "RoleId": "*" } }, "Comment": "Only title can edit group statistics", "Condition": null } ]
not sure what i need to edit here and why, this is my code:
var request = new GetFilesRequest { Entity = oldEntityToken }; PlayFabDataAPI.GetFiles(request, (OnGetFileMeta) => { try { PlayFabHttp.SimpleGetCall(OnGetFileMeta.Metadata[PLAYER_ENTITIES_KEY].DownloadUrl, (OnGetFileFinished) => { UploadEntities(OnGetFileFinished, newEntityToken); }, (error) => { Debug.LogError(string.Format("GetPlayerEntitesByEntityTokenAndUploadToNewEntityToken + {0}", error)); }); } catch (Exception) { Debug.LogError("GetPlayerEntitesByEntityTokenAndUploadToNewEntityToken - GetOldAccountData - faild"); } }, (OnInitFailed) => { Debug.LogError(string.Format("GetPlayerEntitesByEntityTokenAndUploadToNewEntityToken - OnInitFailed + {0}", OnInitFailed.ErrorDetails)); });
Upload Entities:
public static void UploadEntities(byte[] payload, PlayFab.DataModels.EntityKey EntityToken) { try { InitiateFileUploadsRequest initiateFileUploadsRequest = new InitiateFileUploadsRequest() { Entity = EntityToken, FileNames = new List<string>() { PLAYER_ENTITIES_KEY } }; PlayFabDataAPI.InitiateFileUploads(initiateFileUploadsRequest, (response) => { PlayFabHttp.SimplePutCall(response.UploadDetails[0].UploadUrl, payload, (byteArray) => { FinalizeFileUploadsRequest finalizeFileUploadsRequest = new FinalizeFileUploadsRequest { Entity = EntityToken, FileNames = new List<string>() { PLAYER_ENTITIES_KEY } }; PlayFabDataAPI.FinalizeFileUploads(finalizeFileUploadsRequest, (OnUploadSuccess) => { isMergeEntitesDone = true; }, (OnSharedFailure) => { Debug.Log(OnSharedFailure); }); }, (OnSharedFailure) => { Debug.Log(OnSharedFailure); }); }, (OnInitFailed)=> { Debug.LogError(OnInitFailed); }); } catch (System.Exception ex) { Debug.LogError(ex.InnerException); } }
What i am trying to do?
i am trying to merge to accounts into one.