list_grants()
Near Deprecation此操作会列出授予当前角色的所有权限。
请求语法
python
list_grants(
db_name: str
)
参数:
-
db_name (str)
Zilliz Cloud 在其中执行此操作的 Database 名称。
如果指定的 Database 不存在,则返回空结果。
返回类型:
GrantInfo
返回:
包含 GrantItem 对象列表的 GrantInfo 对象。
python
├── GrantInfo
│ └── groups
│ └── GrantItem
│ ├── object
│ ├── object_name
│ ├── role_name
│ ├── grantor_name
│ ├── privilege
│ └── db_name
GrantItem 对象包含以下字段:
异常:
-
MilvusException
如果在此操作期间发生任何错误,则会引发此异常。
示例
python
from pymilvus import Role
# Get an existing role
role = Role(name="root")
# List all privileges granted to the current role.
res = list_grants(
db_name="test_db"
)
相关操作
以下操作与 get_replicas() 相关: