updateRole

Updates a security role definition.

Note: partial updates are not supported for roles, this API route will replace the entire role content with the provided one.


Query Syntax

HTTP

Copied to clipboard!
URL: http://kuzzle:7512/roles/<_id>/_update[?refresh=wait_for]
Method: PUT
Body:
Copied to clipboard!
{
  "controllers": {
    "*": {
      "actions": {
        "*": true
      }
    }
  }
}

Other protocols

Copied to clipboard!
{
  "controller": "security",
  "action": "updateRole",
  "_id": "<roleId>",
  "body": {
    "controllers": {
      "*": {
        "actions": {
          "*": true
        }
      }
    }
  }
}

Arguments

  • _id: role identifier

Optional:

  • refresh: if set to wait_for, Kuzzle will not respond until the role changes are indexed

Body properties


Response

Returns the updated role identifier and version number.

Copied to clipboard!
{
  "status": 200,
  "error": null,
  "action": "updateRole",
  "controller": "security",
  "requestId": "<unique request identifier>",
  "result": {
    "_id": "<roleId>",
    "_version": 2
  }
}