Mercurial > libervia-pubsub
comparison sat_pubsub/backend.py @ 298:648f294601c2
fixed _getNodeGroups call
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 24 Nov 2015 17:02:35 +0100 |
parents | 6ce33757d21e |
children | 07ad8d8fde77 |
comparison
equal
deleted
inserted
replaced
297:4115999d85e9 | 298:648f294601c2 |
---|---|
560 | 560 |
561 if not _entity in roster: | 561 if not _entity in roster: |
562 raise error.NotInRoster | 562 raise error.NotInRoster |
563 return (roster[_entity].groups.intersection(authorized_groups), roster) | 563 return (roster[_entity].groups.intersection(authorized_groups), roster) |
564 | 564 |
565 def _getNodeGroups(self, roster, nodeIdentifier): | 565 def _getNodeGroups(self, roster, nodeIdentifier, pep): |
566 d = self.storage.getNodeGroups(nodeIdentifier) | 566 d = self.storage.getNodeGroups(nodeIdentifier, pep) |
567 d.addCallback(lambda groups: (roster, groups)) | 567 d.addCallback(lambda groups: (roster, groups)) |
568 return d | 568 return d |
569 | 569 |
570 def _rosterEb(self, failure): | 570 def _rosterEb(self, failure): |
571 log.msg("Error while getting roster: {}".format(failure.value)) | 571 log.msg("Error while getting roster: {}".format(failure.value)) |
636 | 636 |
637 if access_model == const.VAL_AMODEL_OPEN or affiliation == 'owner': | 637 if access_model == const.VAL_AMODEL_OPEN or affiliation == 'owner': |
638 d.addCallback(lambda roster: (True, roster)) | 638 d.addCallback(lambda roster: (True, roster)) |
639 d.addCallback(access_checked) | 639 d.addCallback(access_checked) |
640 elif access_model == const.VAL_AMODEL_ROSTER: | 640 elif access_model == const.VAL_AMODEL_ROSTER: |
641 d.addCallback(self._getNodeGroups,node.nodeIdentifier) | 641 d.addCallback(self._getNodeGroups, node.nodeIdentifier, ext_data.get('pep', False)) |
642 d.addCallback(self.checkGroup, requestor) | 642 d.addCallback(self.checkGroup, requestor) |
643 d.addCallback(access_checked) | 643 d.addCallback(access_checked) |
644 | 644 |
645 return d | 645 return d |
646 | 646 |