πŸš€ Try Zilliz Cloud, the fully managed Milvus, for freeβ€”experience 10x faster performance! Try Now>>

milvus-logo
LFAI
< Docs
  • Python

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"
)

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?