// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.mjs` to generate the docs examples

[source, js]
----
const response = await client.security.hasPrivileges({
  cluster: ["monitor", "manage"],
  index: [
    {
      names: ["suppliers", "products"],
      privileges: ["read"],
    },
    {
      names: ["inventory"],
      privileges: ["read", "write"],
    },
  ],
  application: [
    {
      application: "inventory_manager",
      privileges: ["read", "data:write/inventory"],
      resources: ["product/1852563"],
    },
  ],
});
console.log(response);
----
