checkRights #
Available since Kuzzle 2.8.0
Available since 1.1.0
Using the current authentication information, verify if the network connection can execute the required API request.
:::: tabs ::: tab Java
public CompletableFuture<boolean> checkRights(
Map<String, Object> requestPayload) throws NotConnectedException, InternalException
Property | Type | Description |
---|---|---|
requestPayload | Map<String, Object> | Contains a RequestPayload |
requestPayload
#
The RequestPayload must contain at least the following properties:
controller
: API controlleraction
: API action
Returns #
Returns a boolean indicating whether the provided request would have been allowed or not
Usage #
Map<String, Object> body = new HashMap<>();
body.put("name", "Melis");
Map<String, Object> requestPayload = new HashMap<>();
requestPayload.put("controller", "document");
requestPayload.put("action", "create");
requestPayload.put("index", "nyc-open-data");
requestPayload.put("collection", "yellow-taxi");
requestPayload.put("body", body);
Boolean result =
kuzzle.getAuthController().checkRights(requestPayload).get();
::: ::: tab Kotlin
fun checkRights(
requestPayload: Map<String, Any?>): CompletableFuture<Boolean>
Property | Type | Description |
---|---|---|
requestPayload | Map<String, Any?> | Contains a RequestPayload |
requestPayload
#
The RequestPayload must contain at least the following properties:
controller
: API controlleraction
: API action
Returns #
Returns a boolean indicating whether the provided request would have been allowed or not
Usage #
val body = HashMap<String, Any?>().apply {
put("name", "Melis")
}
val requestPayload = HashMap<String, Any?>().apply {
put("controller", "document")
put("action", "create")
put("index", "nyc-open-data")
put("collection", "yellow-taxi")
put("body", body)
}
val result = kuzzle.authController.checkRights(requestPayload).get()
::: ::::
Edit this page on Github(opens new window)