Looking for advice on how to accomplish this. I see this code in src/xf/sitemap/thread.php
$threads = $threadFinder
->where('thread_id', $ids)
->with(['Forum', 'Forum.Node', 'Forum.Node.Permissions|' . $user->permission_combination_id])
->order('thread_id')
->fetch();