feat(rcf): clean right managment, user cannot modify others user datablocks

This commit is contained in:
Swann Martinez
2019-04-22 14:24:19 +02:00
parent 33adb26507
commit 70ff0eef54
4 changed files with 88 additions and 46 deletions

View File

@ -37,11 +37,15 @@ class RCFMessage(object):
def apply(self):
pass
def store(self, dikt):
def store(self, dikt, override=False):
"""Store me in a dict if I have anything to store"""
# this currently erasing old value
if self.key is not None:
dikt[self.key] = self
if self in dikt:
if override:
dikt[self.key] = self
else:
if self.key is not None:
dikt[self.key] = self
# elif self.key in dikt:
# del dikt[self.key]