Skip to content

Commit 8665057

Browse files
committed
Fix xmlrpc permissions for lookup method.
Allow if the key attribute is either searchable or viewable, don't check id attribute.
1 parent 0b94ad3 commit 8665057

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Fixed:
4545
- Fix basic authentication: instatiating the login action would fail if
4646
the user is not set. We now first set the user to anonymous and then
4747
try basic authentication if enabled.
48+
- Fix xmlrpc permissions for lookup method: Allow if the key attribute
49+
is either searchable or viewable, don't check id attribute
4850

4951

5052
2012-05-15: 1.4.20

roundup/xmlrpc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ def lookup(self, classname, key):
103103
cl = self.db.getclass(classname)
104104
uid = self.db.getuid()
105105
prop = cl.getkey()
106-
check = self.db.security.hasSearchPermission
107-
if not check(uid, classname, 'id') or not check(uid, classname, prop):
108-
raise Unauthorised('Permission to search %s denied'%classname)
106+
search = self.db.security.hasSearchPermission
107+
access = self.db.security.hasPermission
108+
if (not search(uid, classname, prop)
109+
and not access('View', uid, classname, prop)):
110+
raise Unauthorised('Permission to lookup %s denied'%classname)
109111
return cl.lookup(key)
110112

111113
def display(self, designator, *properties):

0 commit comments

Comments
 (0)