private List<PrivilegeGrantInfo> getConnectorPrivilege(String catName, String connectorName,
     String principalName, PrincipalType principalType) {

    // normalize string name
    catName = normalizeIdentifier(catName);
    connectorName = normalizeIdentifier(connectorName);

    if (principalName != null) {
      // get all data connector granted privilege
      List<MDCPrivilege> userNameDcPriv = this.listPrincipalMDCGrants(
              principalName, principalType, catName, connectorName);

      // populate and return grantInfos
      if (CollectionUtils.isNotEmpty(userNameDcPriv)) {
        List<PrivilegeGrantInfo> grantInfos = new ArrayList<>(
                userNameDcPriv.size());
        for (int i = 0; i < userNameDcPriv.size(); i++) {
          MDCPrivilege item = userNameDcPriv.get(i);
          grantInfos.add(new PrivilegeGrantInfo(item.getPrivilege(), item
                  .getCreateTime(), item.getGrantor(), getPrincipalTypeFromStr(item
                  .getGrantorType()), item.getGrantOption()));
        }
        return grantInfos;
      }
    }

    // return empty list if no principalName
    return Collections.emptyList();
  }
Add role names of parentRoles and its parents to processedRoles
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java