SDK
SDK Dart Null Safety v3.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.


Copied to clipboard!
Future<bool> checkRights(
    Map<String, dynamic> requestPayload)
Property Type Description
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 #

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