Skip to content

Commit 65e7fe0

Browse files
committed
The access check on properties for an instance of a class
(e.g. .../user/1) was not correct. As a result the access rights on the class not the access right to an instance of a class were checked. This fixes the code so the instance rights are checked the same as calling: .../user/1/roles would.
1 parent 43632c2 commit 65e7fe0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ Features:
4949
- allow user (e.g. in browser) to override response type/Accept
5050
header using extension in url. E.G. .../issues.json. This fixes
5151
the existing code so it works.
52+
- fix SECURITY issue. Retrieving the item of a class
53+
(e.g. /rest/data/user/2) would display properties the user wasn't
54+
allowed to access. Note that unlike the web interface, passwords
55+
and roles for users are still retreivable if the user has access
56+
rights to the properties.
5257
(John Rouillard)
5358
- issue2550833: the export_csv web action now returns labels/names
5459
rather than id's. Replace calls to export_csv with the export_csv_id

roundup/rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def get_element(self, class_name, item_id, input):
494494
for prop_name in props
495495
if self.db.security.hasPermission(
496496
'View', self.db.getuid(), class_name, prop_name,
497-
)
497+
item_id )
498498
]
499499
except KeyError as msg:
500500
raise UsageError("%s field not valid" % msg)

0 commit comments

Comments
 (0)