xpack.security.getUserPrivileges

edit

xpack.security.getUserPrivileges

edit
client.xpack.security.getUserPrivileges()

Reference