mGetProfiles method

Future<List<KuzzleProfile>> mGetProfiles(
  1. List<String> ids
)

Gets multiple security profiles.

Implementation

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

  final profiles = <KuzzleProfile>[];

  for (final hit in response.result['hits']) {
    profiles.add(KuzzleProfile(kuzzle,
        uid: hit['_id'] as String?,
        policies: hit['_source']['policies'] as List<dynamic>?));
  }

  return profiles;
}