Dart 2.x

searchRoles

Searches security roles, optionally returning only those allowing access to the provided controllers.


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

Property Type Description
query
Map<String, dynamic>
Query including allowed controllers 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
controllers
List
Role identifiers

Return

A RoleSearchResult object containing the retrieved Role objects.

Usage

Copied to clipboard!
final result = await kuzzle.security.searchRoles(query:{
  'controllers': ['auth']
});
/*
RoleSearchResult {
  aggregations: undefined,
  hits:
    [ Role { _id: 'admin', controllers: [Object] },
      Role { _id: 'default', controllers: [Object] },
      Role { _id: 'anonymous', controllers: [Object] } ]
  fetched: 3,
  total: 3 }
*/