checkRights method

Future<bool> checkRights(
  1. String kuid,
  2. Map<String, dynamic> requestPayload
)

Checks if an API action can be executed by the current user.

Implementation

Future<bool> checkRights(
    String kuid, Map<String, dynamic> requestPayload) async {
  final response = await kuzzle.query(KuzzleRequest(
    controller: name,
    action: 'checkRights',
    userId: kuid,
    body: requestPayload,
  ));

  return response.result['allowed'] as bool;
}