changeset 4140:3c4545f55949

Allow XMLRPC clients to fetch tracker schema.
author Stefan Seefeld <stefan@seefeld.name>
date Fri, 19 Jun 2009 17:10:07 +0000
parents c5c08eefdf23
children c15fcee3d8a1
files roundup/xmlrpc.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/xmlrpc.py	Wed Jun 17 15:26:07 2009 +0000
+++ b/roundup/xmlrpc.py	Fri Jun 19 17:10:07 2009 +0000
@@ -59,6 +59,14 @@
         self.actions = actions
         self.translator = translator
 
+    def schema(self):
+        s = {}
+        for c in self.db.classes:
+            cls = self.db.classes[c]
+            props = [(n,repr(v)) for n,v in cls.properties.items()]
+            s[c] = props
+        return s
+
     def list(self, classname, propname=None):
         cl = self.db.getclass(classname)
         if not propname:
@@ -107,7 +115,7 @@
         for key in props:
             if not self.db.security.hasPermission('Edit', self.db.getuid(), classname,
                                                   property=key):
-                raise Unauthorised('Permission to create %s denied'%classname)
+                raise Unauthorised('Permission to set %s.%s denied'%(classname, key))
 
         # do the actual create
         try:

Roundup Issue Tracker: http://roundup-tracker.org/