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

[source, python]
----
resp = client.security.put_role(
    name="dept_role",
    indices=[
        {
            "names": [
                "*"
            ],
            "privileges": [
                "read"
            ],
            "query": {
                "term": {
                    "department_id": 12
                }
            }
        }
    ],
)
print(resp)
----
