SDK
SDK Javascript v7.x
2

mDeleteRoles #

Deletes multiple security roles.

Throws a partial error (error code 206) if one or more role deletions fail.


Copied to clipboard!
mDeleteRoles(ids, [options]);

Property Type Description
ids
array<string>
Role identifiers
options
object
Query options

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 roles deletion is indexed

Resolves #

An array of the deleted roles ids.

Usage #

Copied to clipboard!
try {
  const response = await kuzzle.security.mDeleteRoles([
    'role1',
    'role2',
    'role3',
    'role4',
    'role5'
  ]);
  console.log(response);
  /*
  [ 'role1', 'role2', 'role3', 'role4', 'role5' ]
    */
} catch (e) {
  console.error(e);
}