perms_with_data sounds strange. It sounds like permissions + some other data. What data? And if it's about permissions, then why is the query executed on Page.objects?

What you're doing makes perfect sense, but the name of the variable doesn't suggest that. I think something like ```page_ids_and_permissions``` would be a more intuitive name.