private Set<String> filterUsersToRemoveNsAccessAcl(Table aclTable, TableName tableName,
    Set<String> tablesUsers) throws IOException {
    Set<String> removeUsers = new HashSet<>();
    byte[] namespace = tableName.getNamespace();
    for (String user : tablesUsers) {
      List<byte[]> userEntries = SnapshotScannerHDFSAclStorage.getUserEntries(aclTable, user);
      boolean remove = true;
      for (byte[] entry : userEntries) {
        if (
          PermissionStorage.isGlobalEntry(entry)
            || (PermissionStorage.isNamespaceEntry(entry)
              && Bytes.equals(PermissionStorage.fromNamespaceEntry(entry), namespace))
            || (PermissionStorage.isTableEntry(entry) && !Bytes.equals(tableName.getName(), entry)
              && Bytes.equals(TableName.valueOf(entry).getNamespace(), namespace))
        ) {
          remove = false;
          break;
        }
      }
      if (remove) {
        removeUsers.add(user);
      }
    }
    return removeUsers;
  }
Remove table user access HDFS acl from namespace directory if the user has no permissions of
global, ns of the table or other tables of the ns, eg: Bob has 'ns1:t1' read permission, when
delete 'ns1:t1', if Bob has global read permission, '@ns1' read permission or
'ns1:other_tables' read permission, then skip remove Bob access acl in ns1Dirs, otherwise,
remove Bob access acl.
@param aclTable    acl table
@param tableName   the name of the table
@param tablesUsers table users set
@return users whose access acl will be removed from the namespace of the table
@throws IOException if an error occurred
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SnapshotScannerHDFSAclController.java