跳到主要内容

remove_user()

Near Deprecation

此操作会从当前角色中移除某个用户。移除后,该用户将失去当前角色所授予的权限。

请求语法​

python
remove_user(
username: str
)

参数:

  • username (str) -

    [必填]

    要从角色中移除的用户名。

返回类型:

NoneType

返回值:

None

异常:

  • MilvusException

    在此操作期间发生任何错误时,将引发此异常。

示例​

python
from pymilvus import Role

# Get an existing role
role = Role(name=role_name)

# Remove the specified user from the current role
role.remove_user(username)

# List all users of the current role
users = role.get_users()

以下操作与 add_user() 相关:

最低 SDK 版本Inherit