SDK
SDK Javascript v6.x
1

mGetRoles #

Gets multiple security roles.


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

Property Type Description
ids
array<string>
Roles 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

Resolves #

An array of retrieved Role objects.

Usage #

Copied to clipboard!
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);
}