def users_with_any_permission_for_instance(self, actions, instance):
        if 'change' in actions or actions in 'delete':
            # form a filter expression of the users with 'change' permission
            # over this instance's collection
            filter_expr = self._users_with_perm_filter(
                ['change'], collection=instance.collection
            )

            # add on the item's owner, if they still have 'add' permission
            # (and the owner field isn't blank)
            owner = getattr(instance, self.owner_field_name)
            if owner is not None and self._check_perm(
                owner, ['add'], collection=instance.collection
            ):
                filter_expr = filter_expr | Q(pk=owner.pk)

            # return the filtered queryset
            return get_user_model().objects.filter(filter_expr).distinct()

        else:
            # action is either not recognised, or is the 'add' action which is
            # not meaningful for existing instances. As such, the action is only
            # available to superusers
            return get_user_model().objects.filter(is_active=True, is_superuser=True)
dataset/ETHPy150Open torchbox/wagtail/wagtail/wagtailcore/permission_policies/collections.py/CollectionOwnershipPermissionPolicy.users_with_any_permission_for_instance/swapped operands of `in`