fix: Diffusing interoperability parameter to all included objects & references

master
chrisr3d 2020-04-15 18:00:21 +02:00
parent 8e95dbfce2
commit e4f08557ec
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 17 additions and 2 deletions

View File

@ -324,11 +324,26 @@ class _STIXBase(Mapping):
class _DomainObject(_STIXBase, _MarkingsMixin): class _DomainObject(_STIXBase, _MarkingsMixin):
pass def __init__(self, *args, **kwargs):
interoperability = kwargs.get('interoperability', False)
self.__interoperability = interoperability
self._properties['id'].interoperability = interoperability
self._properties['created_by_ref'].interoperability = interoperability
if kwargs.get('object_marking_refs'):
self._properties['object_marking_refs'].contained.interoperability = interoperability
super(_DomainObject, self).__init__(*args, **kwargs)
class _RelationshipObject(_STIXBase, _MarkingsMixin): class _RelationshipObject(_STIXBase, _MarkingsMixin):
pass def __init__(self, *args, **kwargs):
interoperability = kwargs.get('interoperability', False)
self.__interoperability = interoperability
self._properties['id'].interoperability = interoperability
if kwargs.get('created_by_ref'):
self._properties['created_by_ref'].interoperability = interoperability
if kwargs.get('object_marking_refs'):
self._properties['object_marking_refs'].contained.interoperability = interoperability
super(_RelationshipObject, self).__init__(*args, **kwargs)
class _Observable(_STIXBase): class _Observable(_STIXBase):