Javascript 7.x

deleteRole

Deletes a security role.


Copied to clipboard!
deleteRole(id, [options]);

Property Type Description
id
string
Role identifier
options
object
Query options

options

Additional query options

Property Type
(default)
Description
queuable
boolean

(true)
If true, queues the request during downtime, until connected to Kuzzle again
refresh
boolean

(false)
If set to wait_for, Kuzzle will not respond until the role deletion is indexed

Resolves

An acknowledgment message.

Usage

Copied to clipboard!
try {
  const response = await kuzzle.security.deleteRole('myRole');
  console.log(response);
  /*
  { found: true,
    _index: '%kuzzle',
    _type; 'roles',
    _id: 'myRole',,
    _version: 2,
    result: 'deleted',
    _shards: {  total: 2, successful: 1, failed: 0 } }
   */
  console.log('Role successfully deleted');
} catch (e) {
  console.error(e);
}