createRole method

Future<KuzzleRole> createRole(
  1. String id,
  2. Map<String, dynamic> controllers, {
  3. bool? waitForRefresh,
  4. bool? force,
})

Creates a new role.

Implementation

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

  return KuzzleRole.fromKuzzleResponse(kuzzle, response);
}