SDK
SDK Dart Null Safety v3.x
2

searchRoles #

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


Future<RoleSearchResult> searchRoles(
      {Map<String, dynamic> query = const {}, int? from, int? size})

PropertyTypeDescription
query
Map<String, dynamic>
Query including allowed controllers to search for
from
int?
Offset of the first document to fetch
size
int?
Maximum number of documents to retrieve per page

query #

PropertyTypeDescription
controllersList<String>Role identifiers

Return #

A RoleSearchResult object containing the retrieved Role objects.

Usage #

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 }
*/