Dart 2.x

searchProfiles

Searches security profiles, optionally returning only those linked to the provided list of security roles.


Copied to clipboard!
Future<ProfileSearchResult> searchProfiles(
      {Map<String, dynamic> query, int from, int size, String scroll})

Property Type Description
query
Map<String, dynamic>
Query including role identifiers to search for
from
int

(0)
Offset of the first document to fetch
size
int

(10)
Maximum number of documents to retrieve per page
scroll
String

("")
When set, gets a forward-only cursor having its ttl set to the given value (ie 30s; cf elasticsearch time limits)

query

Property Type Description
roles
List
Role identifiers

Return

A ProfileSearchResult object containing the retrieved Profile objects.

Usage

Copied to clipboard!
final result = await kuzzle.security.searchProfiles(query:{
  'roles': [ 'default' ]
});
/*
ProfileSearchResult { aggregations: undefined,
  hits:
    [ Profile { _id: 'profile1', policies: [Array] },
      Profile { _id: 'profile2', policies: [Array] },
      Profile { _id: 'profile3', policies: [Array] },
      Profile { _id: 'default', policies: [Array] } ],
  fetched: 4,
  total: 4 }
*/