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)
Property | Type | Description |
---|---|---|
kuid | String | User kuid |
requestPayload | Map<String, dynamic> | Contains a RequestPayload |
requestPayload
#
The RequestPayload must contain at least the following properties:
controller
: API controlleraction
: 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);
Edit this page on Github(opens new window)