diff --git a/roundup/xmlrpc.py b/roundup/xmlrpc.py
index f41c6d6f5905cfde0fb8ce966f6346abac677892..b0495d07018aad4def9a220a9abac6f5e15f1b09 100644 (file)
--- a/roundup/xmlrpc.py
+++ b/roundup/xmlrpc.py
raise UsageError, 'you must provide the "%s" property.'%key
for key in props:
- if not self.db.security.hasPermission('Edit', self.db.getuid(), classname,
- property=key):
- raise Unauthorised('Permission to set %s.%s denied'%(classname, key))
+ if not self.db.security.hasPermission('Create', self.db.getuid(),
+ classname, property=key):
+ raise Unauthorised('Permission to create %s.%s denied'%(classname, key))
# do the actual create
try:
result = cl.create(**props)
+ self.db.commit()
except (TypeError, IndexError, ValueError), message:
raise UsageError, message
return result
raise Unauthorised('Permission to edit %s of %s denied'%
(p, designator))
try:
- return cl.set(itemid, **props)
+ result = cl.set(itemid, **props)
+ self.db.commit()
except (TypeError, IndexError, ValueError), message:
raise UsageError, message
+ return result
builtin_actions = {'retire': actions.Retire}
def __init__(self, db, actions, translator,
allow_none=False, encoding=None):
- SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
+ try:
+ # python2.5 and beyond
+ SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
+ except TypeError:
+ # python2.4
+ SimpleXMLRPCDispatcher.__init__(self)
self.register_instance(RoundupInstance(db, actions, translator))