server/session.py
changeset 2604 6b55a2a81fd8
parent 2603 e47d63351891
child 2616 4501ee760eec
--- a/server/session.py	Fri Jul 31 23:44:16 2009 +0200
+++ b/server/session.py	Fri Jul 31 23:45:07 2009 +0200
@@ -73,6 +73,17 @@
     def __str__(self):
         return '<%ssession %s (%s 0x%x)>' % (self.cnxtype, self.user.login,
                                              self.id, id(self))
+
+    def add_relation(self, fromeid, rtype, toeid):
+        if self.is_super_session:
+            self.repo.glob_add_relation(self, fromeid, rtype, toeid)
+            return
+        self.is_super_session = True
+        try:
+            self.repo.glob_add_relation(self, fromeid, rtype, toeid)
+        finally:
+            self.is_super_session = False
+
     # resource accessors ######################################################
 
     def actual_session(self):