comparison sat_pubsub/backend.py @ 308:087b705493a6

fixed publisher check on item publishing
author Goffi <goffi@goffi.org>
date Fri, 18 Dec 2015 13:01:02 +0100
parents bf4098a6cbb7
children 890b24b37b56
comparison
equal deleted inserted replaced
307:c057d78b482f 308:087b705493a6
289 289
290 def _checkOverwrite(self, node, itemIdentifiers, publisher): 290 def _checkOverwrite(self, node, itemIdentifiers, publisher):
291 """Check that the itemIdentifiers correspond to items published 291 """Check that the itemIdentifiers correspond to items published
292 by the current publisher""" 292 by the current publisher"""
293 def doCheck(item_pub_map): 293 def doCheck(item_pub_map):
294 for item_publisher in item_pub_map.iterValues(): 294 for item_publisher in item_pub_map.itervalues():
295 if item_publisher.userhost() != publisher.userhost(): 295 if item_publisher.userhost() != publisher.userhost():
296 raise error.ItemForbidden() 296 raise error.ItemForbidden()
297 297
298 d = node.getItemsPublishers(itemIdentifiers) 298 d = node.getItemsPublishers(itemIdentifiers)
299 d.addCallback(doCheck) 299 d.addCallback(doCheck)