mGetRoles method

Future<List<KuzzleRole>> mGetRoles(
  1. List<String?> ids
)

Gets multiple security roles.

Implementation

Future<List<KuzzleRole>> mGetRoles(List<String?> ids) async {
  final response = await kuzzle.query(KuzzleRequest(
      controller: name,
      action: 'mGetRoles',
      body: <String, dynamic>{
        'ids': ids,
      }));

  final roles = <KuzzleRole>[];

  for (final hit in response.result['hits']) {
    roles.add(KuzzleRole(kuzzle,
        uid: hit['_id'] as String?,
        controllers: hit['_source']['controllers'] as Map<String, dynamic>?));
  }

  return roles;
}