comparison sat/memory/memory.py @ 3349:2a7e36b69fd2

core (memory/memory): fixed assignations
author Goffi <goffi@goffi.org>
date Sat, 05 Sep 2020 20:20:05 +0200
parents 4f1fcee83d36
children b14e95f7034f
comparison
equal deleted inserted replaced
3348:12c427156cac 3349:2a7e36b69fd2
1228 # block anyway, this avoid to have to recursively change permissions for 1228 # block anyway, this avoid to have to recursively change permissions for
1229 # all sub directories/files when modifying a permission 1229 # all sub directories/files when modifying a permission
1230 if not file_data.get('parent'): 1230 if not file_data.get('parent'):
1231 raise exceptions.PermissionError() 1231 raise exceptions.PermissionError()
1232 else: 1232 else:
1233 perm_type == C.ACCESS_TYPE_PUBLIC 1233 perm_type = C.ACCESS_TYPE_PUBLIC
1234 if perm_type == C.ACCESS_TYPE_PUBLIC: 1234 if perm_type == C.ACCESS_TYPE_PUBLIC:
1235 continue 1235 continue
1236 elif perm_type == C.ACCESS_TYPE_WHITELIST: 1236 elif perm_type == C.ACCESS_TYPE_WHITELIST:
1237 try: 1237 try:
1238 jids = perm_data["jids"] 1238 jids = perm_data["jids"]
1339 file_data: dict, 1339 file_data: dict,
1340 affiliations: Dict[jid.JID, str] 1340 affiliations: Dict[jid.JID, str]
1341 ) -> None: 1341 ) -> None:
1342 read_data = access.setdefault(C.ACCESS_PERM_READ, {}) 1342 read_data = access.setdefault(C.ACCESS_PERM_READ, {})
1343 if read_data.get('type') != C.ACCESS_TYPE_WHITELIST: 1343 if read_data.get('type') != C.ACCESS_TYPE_WHITELIST:
1344 read_data['type'] == C.ACCESS_TYPE_WHITELIST 1344 read_data['type'] = C.ACCESS_TYPE_WHITELIST
1345 if 'jids' not in read_data: 1345 if 'jids' not in read_data:
1346 read_data['jids'] = [] 1346 read_data['jids'] = []
1347 read_whitelist = read_data['jids'] 1347 read_whitelist = read_data['jids']
1348 write_data = access.setdefault(C.ACCESS_PERM_WRITE, {}) 1348 write_data = access.setdefault(C.ACCESS_PERM_WRITE, {})
1349 if write_data.get('type') != C.ACCESS_TYPE_WHITELIST: 1349 if write_data.get('type') != C.ACCESS_TYPE_WHITELIST:
1350 write_data['type'] == C.ACCESS_TYPE_WHITELIST 1350 write_data['type'] = C.ACCESS_TYPE_WHITELIST
1351 if 'jids' not in write_data: 1351 if 'jids' not in write_data:
1352 write_data['jids'] = [] 1352 write_data['jids'] = []
1353 write_whitelist = write_data['jids'] 1353 write_whitelist = write_data['jids']
1354 for entity_jid, affiliation in affiliations.items(): 1354 for entity_jid, affiliation in affiliations.items():
1355 entity_jid_s = entity_jid.full() 1355 entity_jid_s = entity_jid.full()