def _get_users_with_any_permission_codenames_filter(self, permission_codenames):
        permissions = Permission.objects.filter(
            content_type=self._content_type,
            codename__in=permission_codenames
        )
        return (
            Q(is_superuser=True) |
            Q(user_permissions__in=permissions) |
            Q(groups__permissions__in=permissions)
        ) & Q(is_active=True)
Given a list of permission codenames, return a filter expression which
dataset/ETHPy150Open torchbox/wagtail/wagtail/wagtailcore/permission_policies/base.py/BaseDjangoAuthPermissionPolicy._get_users_with_any_permission_codenames_filter