Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Latest commit

 

History

History
46 lines (32 loc) · 1.86 KB

File metadata and controls

46 lines (32 loc) · 1.86 KB
code type title description
true
page
createRole
Security:createRole

createRole

Create a new role in Kuzzle.

:::info There is a small delay between role creation and its availability in our search layer (usually a couple of seconds). That means that a role that was just created may not be returned immediately by the searchRoles function. :::


createRole(id, content, [options], callback)

Arguments Type Description
id string Unique role identifier
content JSON Object A plain JSON object representing the role
options string (Optional) Optional arguments
callback function Callback handling the response

Options

Filter Type Description Default
replaceIfExist boolean If the same role already exists: throw an error if sets to false. Replace the existing role otherwise false
queuable boolean Make this request queuable or not true
refresh string If set to wait_for, Kuzzle will wait the persistence layer to finish indexing (available with Elasticsearch 5.x and above) undefined

Callback Response

Returns a Role object.

Usage

<<< ./snippets/create-role-1.php