public static List<Partition> filterPartitionsIfEnabled(
      boolean isFilterEnabled,
      MetaStoreFilterHook filterHook, List<Partition> partitions) throws MetaException {

    if (isFilterEnabled) {
      return filterHook.filterPartitions(partitions);
    }

    return partitions;
  }
Filter the list of partitions 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 partitions: the list of partitions
@return the list of partitions that user has access or original list if filtering is disabled;
@throws MetaException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FilterUtils.java