// This file is autogenerated, DO NOT EDIT
// security/authorization/document-level-security.asciidoc:46

[source, python]
----
resp = client.security.put_role(
    name="click_role",
    indices=[
        {
            "names": [
                "events-*"
            ],
            "privileges": [
                "read"
            ],
            "query": {
                "match": {
                    "category": "click"
                }
            }
        }
    ],
)
print(resp)
----
