comparison sat_pubsub/backend.py @ 256:ea44c0986f47

Fixed getItems for roster access items when the subscriber is not owner of the node.
author Goffi <goffi@goffi.org>
date Wed, 17 Apr 2013 22:28:41 +0200
parents d55620ceafed
children 30988781f30d
comparison
equal deleted inserted replaced
255:d55620ceafed 256:ea44c0986f47
502 def access_checked(access_data): 502 def access_checked(access_data):
503 authorized, roster = access_data 503 authorized, roster = access_data
504 if not authorized: 504 if not authorized:
505 raise error.NotAuthorized() 505 raise error.NotAuthorized()
506 506
507 roster_item = roster.get(requestor.userhost()) 507 roster_item = roster.get(requestor.userhostJID())
508 authorized_groups = tuple(roster_item.groups) if roster_item else tuple() 508 authorized_groups = tuple(roster_item.groups) if roster_item else tuple()
509 509
510 if itemIdentifiers: 510 if itemIdentifiers:
511 return node.getItemsById(authorized_groups, affiliation == 'owner', itemIdentifiers) 511 return node.getItemsById(authorized_groups, affiliation == 'owner', itemIdentifiers)
512 else: 512 else: