private List<String> getFilteredTableNames(List<HivePrivilegeObject> hivePrivilegeObjects, String databaseName, List<String> tableNames) {
    List<String> ret = new ArrayList<>();
    final TablePrivilegeLookup index = new TablePrivilegeLookup(hivePrivilegeObjects);
    for(String tableName : tableNames) {
      if (index.lookup(databaseName, tableName) != null) {
        ret.add(tableName);
      }
    }
    return ret;
  }
HiveMetaStoreAuthorizer :  Do authorization checks on MetaStore Events in MetaStorePreEventListener
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/HiveMetaStoreAuthorizer.java