UpdateSystemEntityAcl
Updates an existing System Entity's ACL on the server, regardless of the entity's current ACL permissions. Note that for obvious security reasons, this API method is available via cloud-code only.
This method is affected by versioning. See the versioning documentation for more information.
Service | Operation |
---|---|
globalEntity | UPDATE_ACL |
Method Parameters
Parameter | Description |
---|---|
entityId | The id of the entity to update |
version | The version of the entity to update. Use -1 to indicate the newest version |
jsonEntityAcl | The entity's Access Control List as json. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var entityId = "a-entity-id";
var version = 2;
var jsonEntityAcl = {
"other": 1
};
var globalEntityProxy = bridge.getGlobalEntityServiceProxy();
var postResult = globalEntityProxy.updateSystemEntityAcl(entityId, version, jsonEntityAcl);
if (postResult.status == 200) {
// Success!
}
{
"service": "globalEntity",
"operation": "UPDATE_ACL",
"data": {
"entityId": "the-entity-id",
"version": 2,
"acl": {
"other": 1
}
}
}
JSON Response
{
"status": 200,
"data": {
"gameId": "123456",
"entityId": "14281c38-abf6-4ca2-8436-b2bdwas8d5a9a",
"ownerId": "784cc6c6-4569-4d75-bd10-62dwa8ae0218",
"entityType": "test",
"entityIndexedId": "indexTest",
"version": 1,
"acl": {
"other": 1
},
"expiresAt": 1449861422588,
"timeToLive": 34567,
"createdAt": 1449861388021,
"updatedAt": 1449861388021
}
}
Common Error Code
Status Codes
Code | Name | Description |
---|---|---|
40344 | ENTITY_VERSION_MISMATCH | The version passed in does not match the version of the entity on the server |