server/repository.py
changeset 6333 e3994fcc21c3
parent 6279 42079f752a9c
parent 6308 c151c730a1ac
child 6368 f907cc7f2875
--- a/server/repository.py	Tue Sep 21 16:35:37 2010 +0200
+++ b/server/repository.py	Thu Sep 23 23:28:58 2010 +0200
@@ -464,13 +464,24 @@
         cubes.remove('cubicweb')
         return cubes
 
-    def get_option_value(self, option):
-        """Return the value for `option` in the configuration.
+    def get_option_value(self, option, foreid=None):
+        """Return the value for `option` in the configuration. If `foreid` is
+        specified, the actual repository to which this entity belongs is
+        derefenced and the option value retrieved from it.
 
         This is a public method, not requiring a session id.
         """
         # XXX we may want to check we don't give sensible information
-        return self.config[option]
+        if foreid is None:
+            return self.config[option]
+        _, sourceuri, extid = self.type_and_source_from_eid(foreid)
+        if sourceuri == 'system':
+            return self.config[option]
+        pool = self._get_pool()
+        try:
+            return pool.connection(sourceuri).get_option_value(option, extid)
+        finally:
+            self._free_pool(pool)
 
     @cached
     def get_versions(self, checkversions=False):