public static List<String> filterDbNamesIfEnabled(
      boolean isFilterEnabled,
      MetaStoreFilterHook filterHook,
      List<String> dbNames) throws MetaException {

    if (isFilterEnabled) {
      return filterHook.filterDatabases(dbNames);
    }

    return dbNames;
  }
Filter the list of databases if filtering is enabled. Otherwise, return original list
@param isFilterEnabled true: filtering is enabled; false: filtring is disabled.
@param filterHook: the object that does filtering
@param dbNames: the list of database names to filter
@return the list of database names that current user has access if filtering is enabled;
        otherwise, the original list
@throws MetaException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FilterUtils.java