// This file is autogenerated, DO NOT EDIT
// security/authorization/run-as-privilege.asciidoc:51

[source, python]
----
resp = client.security.put_role(
    name="my_director",
    refresh=True,
    cluster=[
        "manage"
    ],
    indices=[
        {
            "names": [
                "index1",
                "index2"
            ],
            "privileges": [
                "manage"
            ]
        }
    ],
    run_as=[
        "jacknich",
        "rdeniro"
    ],
    metadata={
        "version": 1
    },
)
print(resp)
----
