SDK
SDK Dart v2.x
2

checkRights #

Available since 2.8.0

Checks if the provided API request can be executed by the current user.


Future<bool> checkRights(
    String kuid, Map<String, dynamic> requestPayload)
PropertyTypeDescription
kuid
String
User kuid
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
  .security
  .checkRights('foo', requestPayload);