GrantV2()
This method grants a privilege or a privilege group to a role.
func (c *Client) GrantV2(ctx context.Context, option GrantV2Option, callOptions ...grpc.CallOption) error
Request Parameters
Parameter |
Description |
Type |
---|---|---|
|
Context for the current call to work. |
|
|
Optional parameters of the methods. |
|
|
Optional parameters for calling the methods. |
|
GrantV2Option
This is an interface type. The grantV2Option
struct type implements this interface type.
You can use the NewGrantV2Option()
function to get the concrete implementation.
NewGrantV2Option
The signature of the NewGrantV2Option()
is as follows:
func NewGrantV2Option(roleName, privilegeName, dbName, collectionName string) *grantV2Option
Parameter |
Description |
Type |
---|---|---|
|
Name of the target role of this operation. |
|
|
Name of the privilege or privilege group to assign. For details, refer to the Privilege name column in the table on page Users and Roles. |
|
|
Name of the target database. |
|
|
Name of the target collection. |
|
grpc.CallOption
This interface provided by the gRPC Go library allows you to specify additional options or configurations when making requests. For possible implementations of this interface, refer to this file.
Return
Null
Example
// TODO
// https://milvus.io/api-reference/pymilvus/v2.5.x/MilvusClient/Authentication/grant_privilege.md