list_grants()
This operation lists all privileges granted to the current role.
Request Syntax
list_grants(
db_name: str
)
PARAMETERS:
db_name (str)
The name of a database in which Milvus carries out this operation.
If the specified database does not exist, an empty result returns.
RETURN TYPE:
GrantInfo
RETURNS:
A GrantInfo object that contains a list of GrantItem objects.
βββ GrantInfo
β βββ groups
β βββ GrantItem
β βββ object
β βββ object_name
β βββ role_name
β βββ grantor_name
β βββ privilege
β βββ db_name
The GrantItem objects contains the following fields:
EXCEPTIONS:
MilvusException
This exception will be raised when any error occurs during this operation.
Examples
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"
)