def METHOD_NAME(self, parent_context):
    site_name = get_site_for_user(self.request.user)["site_name"]
    return {
        "total_images": permission_policy.instances_user_has_any_permission_for(
            self.request.user, {"add", "change", "delete", "choose"}
        ).count(),
        "site_name": site_name,
    }