Determine whether the specified user has a specified list of privileges.
All users can use this API, but only to determine their own privileges.
To check the privileges of other users, you must use the run as feature.
A list of the privileges that you want to check for the specified resources.
It may be either application privilege names or the names of actions that are granted by those privileges
resourcesstring[]required
A list of resource names against which the privileges should be checked.
clusterunionanyOf[]
A list of the cluster privileges that you want to check.
This needs to be set to true (default is false) if using wildcards or regexps for patterns that cover restricted indices.
Implicitly, restricted indices do not match index patterns because restricted indices usually have limited privileges and including them in pattern tests would render most such tests false.
If restricted indices are explicitly included in the names list, privileges will be checked against them regardless of the value of allow_restricted_indices.