createRestrictedUser method

Future<KuzzleUser> createRestrictedUser(
  1. Map<String, dynamic> body,
  2. String id, {
  3. bool? waitForRefresh,
})

Creates a new user in Kuzzle, with a preset list of security profiles.

The list of security profiles attributed to restricted users is fixed, and must be configured in the Kuzzle configuration file.

This method allows users with limited rights to create other accounts, but blocks them from creating accounts with unwanted privileges (e.g. an anonymous user creating his own account).

Implementation

Future<KuzzleUser> createRestrictedUser(Map<String, dynamic> body, String id,
    {bool? waitForRefresh}) async {
  final response = await kuzzle.query(KuzzleRequest(
      controller: name,
      action: 'createRestrictedUser',
      uid: id,
      waitForRefresh: waitForRefresh,
      body: body));

  return KuzzleUser.fromKuzzleResponse(kuzzle, response);
}