This method grants privileges to the current role.
grant(object, object_name, privilege)
|Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive.||String||True|
|Name of the object to which the role is granted the specified prvilege.||String||True|
|Name of the privilege to be granted to the role. This parameter is case-sensitive.||String||True|
For details on applicable objects and privileges, refer to Users and Roles.
from pymilvus import connections from pymilvus.orm.role import Role connections.connect() role = Role(role_name) role.grant("Collection", collection_name, "Insert")