Mercurial > libervia-pubsub
comparison src/backend.py @ 392:3fb2ff438f09
backed: allow admins to overwritte any item
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 15 Feb 2019 18:05:31 +0100 |
parents | 66128656f76c |
children | dc83b1d837cf |
comparison
equal
deleted
inserted
replaced
391:1d2222a91e6b | 392:3fb2ff438f09 |
---|---|
413 self.enforceSchema(item, schema, affiliation) | 413 self.enforceSchema(item, schema, affiliation) |
414 items_data.append(container.ItemData(item, access_model, item_config, categories, new=new_item)) | 414 items_data.append(container.ItemData(item, access_model, item_config, categories, new=new_item)) |
415 | 415 |
416 if persistItems: | 416 if persistItems: |
417 | 417 |
418 if check_overwrite and affiliation != 'owner': | 418 if check_overwrite and affiliation != 'owner' and not self.isAdmin(requestor): |
419 # we don't want a publisher to overwrite the item | 419 # we don't want a publisher to overwrite the item |
420 # of an other publisher | 420 # of an other publisher |
421 yield self._checkOverwrite(node, [item['id'] for item in items if item.getAttribute('id')], requestor) | 421 yield self._checkOverwrite(node, [item['id'] for item in items if item.getAttribute('id')], requestor) |
422 | 422 |
423 # TODO: check conflict and recalculate max id if serial_ids is set | 423 # TODO: check conflict and recalculate max id if serial_ids is set |