Skip to main content
Version: 5.7.0

UpdateEntityOwnerAndAcl

Method updates an existing entity's owner and ACL on the server.

This method is affected by versioning. See the versioning documentation for more information.

ServiceOperation
globalEntityUPDATE_ENTITY_OWNER_AND_ACL

Method Parameters

ParameterDescription
entityIdThe id of the entity to update
versionThe version of the entity to update. Use -1 to indicate the newest version
ownerIdThe id of the new owner
jsonEntityAclThe entity's Access Control List as json.

Usage

http://localhost:3000
string entityId = "a-entity-id";
int version = 2;
string ownerId = "sdjhghfhgsdjkkfjg";
ACL jsonEntityAcl = new ACL(ACL.Access.Read);
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.GlobalEntityService.UpdateEntityOwnerAndAcl(entityId, version, entityId, jsonEntityAcl, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"gameId": "123456",
"entityId": "14281c38-abf6-4ca2-8436-b2bdwas8d5a9a",
"ownerId": "g45egg4gg-gsstgtrg-gfgsdf",
"entityType": "test",
"entityIndexedId": "indexTest",
"version": 1,
"data": {
"testData": 1234
},
"acl": {
"other": 1
},
"expiresAt": 1449861422588,
"timeToLive": 34567,
"createdAt": 1449861388021,
"updatedAt": 1449861388021
}
}
Common Error Code

Status Codes

CodeNameDescription
40344ENTITY_VERSION_MISMATCHThe version passed in does not match the version of the entity on the server
40532INVALID_OWNER_IDThe ownerId passed does not reference a valid user on the server