milvus-logo
LFAI
< Docs
  • Python

add_user()

This method associates a user with the current role. After this operation, the user can access the privileges that bind to the role.

Invocation

add_user(username)

Parameters

ParameterDescriptionTypeRequired
usernameName of the user to be associated with the roleStringTrue

Return

No return

Example

from pymilvus import connections
from pymilvus.orm.role import Role
connections.connect()
role = Role(name=role_name)
role.add_user(username)
users = role.get_users()
print(f"users added to the role: {users}")