SDK
SDK Dart v2.x
2

checkRights #

Available since Kuzzle 2.8.0
Available since 2.2.0

Checks if the provided API request can be executed by this client, using the current authentication information.


Future<bool> checkRights(
    Map<String, dynamic> requestPayload)
PropertyTypeDescription
requestPayload
Map<String, dynamic>
Contains a RequestPayload

requestPayload #

The RequestPayload must contain at least the following properties:

  • controller: API controller
  • action: API action

Returns #

Returns a boolean telling whether the provided request is allowed or not.

Usage #

final requestPayload = {
  'controller': 'document',
  'action': 'create',
  'index': 'nyc-open-data',
  'collection': 'yellow-taxi',
  'body': {
    'name': 'Melis'
  }
};
final result = await kuzzle
  .auth
  .checkRights(requestPayload);