Skip to content

Commit 35abf05

Browse files
committed
Allow XMLRPC clients to fetch tracker schema.
1 parent a02ab4d commit 35abf05

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

roundup/xmlrpc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ def __init__(self, db, actions, translator):
5959
self.actions = actions
6060
self.translator = translator
6161

62+
def schema(self):
63+
s = {}
64+
for c in self.db.classes:
65+
cls = self.db.classes[c]
66+
props = [(n,repr(v)) for n,v in cls.properties.items()]
67+
s[c] = props
68+
return s
69+
6270
def list(self, classname, propname=None):
6371
cl = self.db.getclass(classname)
6472
if not propname:
@@ -107,7 +115,7 @@ def create(self, classname, *args):
107115
for key in props:
108116
if not self.db.security.hasPermission('Edit', self.db.getuid(), classname,
109117
property=key):
110-
raise Unauthorised('Permission to create %s denied'%classname)
118+
raise Unauthorised('Permission to set %s.%s denied'%(classname, key))
111119

112120
# do the actual create
113121
try:

0 commit comments

Comments
 (0)