# HG changeset patch # User Ralf Schlatterbeck # Date 1581519659 -3600 # Node ID 00a24243887c0f083e721977e69df94fb5898086 # Parent c172bd18fa945ef51aae2e888b10df72eaf184e2 Remove redundant permission check diff -r c172bd18fa94 -r 00a24243887c roundup/rest.py --- a/roundup/rest.py Wed Feb 12 12:35:33 2020 +0100 +++ b/roundup/rest.py Wed Feb 12 16:00:59 2020 +0100 @@ -697,7 +697,7 @@ ): sort.append((ss, pn)) else : - raise (Unauthorised ( + raise (Unauthorised( 'User does not have search permission on "%s.%s"' % (class_name, pn))) elif key.startswith("@"): @@ -725,7 +725,7 @@ if not self.db.security.hasSearchPermission( uid, class_name, key ): - raise (Unauthorised ( + raise (Unauthorised( 'User does not have search permission on "%s.%s"' % (class_name, key))) @@ -793,12 +793,9 @@ ): r = {'id': item_id, 'link': class_path + item_id} if display_props: - for p in display_props: - if self.db.security.hasPermission( - 'View', uid, class_name, itemid=item_id, property=p - ): - r.update(self.format_item(class_obj.getnode(item_id), - item_id, props=display_props, verbose=verbose)) + # format_item does the permission checks + r.update(self.format_item(class_obj.getnode(item_id), + item_id, props=display_props, verbose=verbose)) if r: result['collection'].append(r)