add_privileges_to_group()

Deprecated.

This API is an ORM-style PyMilvus API and will be removed in PyMilvus 3.1. Use MilvusClient instead.

This operation adds privileges to a privilege group for the current role.

To complete this operation, you need to enable authentication on your Milvus instance. For details, refer to Authenticate User Access.

Request Syntax

add_privileges_to_group(
    privilege_group: str,
    privileges: list
) 

PARAMETERS:

  • privilege_group (string)

    [REQUIRED]

    The name of the target privilege group.

  • privileges (list)

    [REQUIRED]

    A list of privilege names to add.

RETURN TYPE:

NoneType

RETURNS:

None

EXCEPTIONS:

  • MilvusException

    This exception will be raised when any error occurs during this operation.

Example

from pymilvus import Role

# Create a role
role = Role("read_only")
role.create()

# Create a privilege group
role.create_privilege_group("read_only_privileges")

# Add privileges to the privilege group
role.add_privileges_to_group("read_only_privileges", ["Search", "Get"])

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?