def user_has_any_permission_for_instance(self, user, actions, instance):
        if actions in 'change' or 'delete' in actions:
            if self._check_perm(user, ['change'], collection=instance.collection):
                return True
            elif (
                self._check_perm(user, ['add'], collection=instance.collection) and
                getattr(instance, self.owner_field_name) == user
            ):
                return True
            else:
                return False
        else:
            # 'change' and 'delete' are the only actions that are well-defined
            # for specific instances. Other actions are only available to
            # active superusers.
            return user.is_active and user.is_superuser
dataset/ETHPy150Open torchbox/wagtail/wagtail/wagtailcore/permission_policies/collections.py/CollectionOwnershipPermissionPolicy.user_has_any_permission_for_instance/swapped operands of `in`