From 6dc41efe66e1a753dd907c73c40ad05286dab012 Mon Sep 17 00:00:00 2001 From: stefan Date: Fri, 19 Jun 2009 17:10:07 +0000 Subject: [PATCH] Allow XMLRPC clients to fetch tracker schema. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4233 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/xmlrpc.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roundup/xmlrpc.py b/roundup/xmlrpc.py index 0014df3..f41c6d6 100644 --- a/roundup/xmlrpc.py +++ b/roundup/xmlrpc.py @@ -59,6 +59,14 @@ class RoundupInstance: 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 @@ class RoundupInstance: 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: -- 2.30.2