SDK
SDK Javascript v6.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

mGetRoles #

Gets multiple security roles.


mGetRoles(ids, [options]);

PropertyTypeDescription
ids
array<string>
Roles identifiers
options
object
Query options

options #

PropertyType
(default)
Description
queuable
boolean

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

Resolves #

An array of retrieved Role objects.

Usage #

try {
  const response = await kuzzle.security.mGetRoles([
    'role1',
    'role2',
    'role3'
  ]);
  console.log(response);
  /*
  [ Role {
      _id: 'role1',
      controllers: { '*': [Object] } },
    Role {
      _id: 'role2',
      controllers: { '*': [Object] } },
    Role {
      _id: 'role3',
      controllers: { '*': [Object] } } ]
   */
} catch (e) {
  console.error(e);
}