GrantV2()
This method grants a privilege or a privilege group to a role. In Milvus, you can allocate multiple privileges or privilege groups to a role and grant the role to a user so that the user gains the privileges allocated to the 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) *grantPrivilegeV2Option
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 of this operation |
|
| 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