A MilvusClient interface. This method lists information about the privileges granted to a role.

Note: Lists a GrantInfo object for the role.
R<SelectGrantResponse> selectGrantForRole(SelectGrantForRoleParam requestParam);


Use the RevokeRolePrivilegeParam.Builder to construct a RevokeRolePrivilegeParam object.

import io.milvus.param.SelectGrantForRoleParam;
SelectGrantForRoleParam.Builder builder = SelectGrantForRoleParam.newBuilder();

Methods of CreateRoleParam.Builder:

withRoleName(String roleName)Sets the role name. The role name cannot be empty or null.roleName: The role name used to create the privilege.

The can throw the following exceptions:

  • ParamException: error if the parameter is invalid.


  • If the API fails on the server side, it returns an error code and an error message.
  • If the API fails due to RPC exceptions, it returns R.Status.Unknown and error message of the exception.
  • If the API succeeds, it returns R.Status.Success.


import io.milvus.param.SelectGrantForRoleParam;

R<RpcStatus> response = client.selectGrantForRole(SelectGrantForRoleParam.newBuilder()

if (response.getStatus() != R.Status.Success.getCode()) {
    throw new RuntimeException(response.getMessage());