--- a/server/sources/__init__.py Thu Aug 27 17:01:32 2009 +0200
+++ b/server/sources/__init__.py Thu Aug 27 17:02:02 2009 +0200
@@ -182,6 +182,19 @@
return wsupport
return True
+ def may_cross_relation(self, rtype):
+ """return True if the relation may be crossed among sources. Rules are:
+
+ * if this source support the relation, can't be crossed unless explicitly
+ specified in .cross_relations
+
+ * if this source doesn't support the relation, can be crossed unless
+ explicitly specified in .dont_cross_relations
+ """
+ if self.support_relation(rtype):
+ return rtype in self.cross_relations
+ return rtype not in self.dont_cross_relations
+
def eid2extid(self, eid, session=None):
return self.repo.eid2extid(self, eid, session)
--- a/server/sources/native.py Thu Aug 27 17:01:32 2009 +0200
+++ b/server/sources/native.py Thu Aug 27 17:02:02 2009 +0200
@@ -268,6 +268,9 @@
# can't claim not supporting a relation
return True #not rtype == 'content_for'
+ def may_cross_relation(self, rtype):
+ return True
+
def authenticate(self, session, login, password):
"""return CWUser eid for the given login/password if this account is
defined in this source, else raise `AuthenticationError`