Mercurial > libervia-pubsub
diff idavoll/generic_backend.py @ 162:84cfe9fe38c5
Comply with the access model 'open'.
Currently, the only implemented access model is 'open', so we should not check
for the subscription of the requestor for item retrieval. We do reject
outcasts.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Wed, 06 Sep 2006 12:57:53 +0000 |
parents | 6fe78048baf9 |
children |
line wrap: on
line diff
--- a/idavoll/generic_backend.py Wed Sep 06 12:43:10 2006 +0000 +++ b/idavoll/generic_backend.py Wed Sep 06 12:57:53 2006 +0000 @@ -265,20 +265,15 @@ def get_items(self, node_id, requestor, max_items=None, item_ids=[]): d = self.parent.storage.get_node(node_id) - d.addCallback(self._is_subscribed, requestor) + d.addCallback(_get_affiliation, requestor) d.addCallback(self._do_get_items, max_items, item_ids) return d - def _is_subscribed(self, node, subscriber): - d = node.is_subscribed(subscriber) - d.addCallback(lambda subscribed: (node, subscribed)) - return d + def _do_get_items(self, result, max_items, item_ids): + node, affiliation = result - def _do_get_items(self, result, max_items, item_ids): - node, subscribed = result - - if not subscribed: - raise backend.NotSubscribed + if affiliation == 'outcast': + raise backend.Forbidden if item_ids: return node.get_items_by_id(item_ids)