Skip to content

Commit c6a0bcb

Browse files
committed
Remove redundant permission check
1 parent 0ee03e9 commit c6a0bcb

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

roundup/rest.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ def get_collection(self, class_name, input):
697697
):
698698
sort.append((ss, pn))
699699
else :
700-
raise (Unauthorised (
700+
raise (Unauthorised(
701701
'User does not have search permission on "%s.%s"'
702702
% (class_name, pn)))
703703
elif key.startswith("@"):
@@ -725,7 +725,7 @@ def get_collection(self, class_name, input):
725725
if not self.db.security.hasSearchPermission(
726726
uid, class_name, key
727727
):
728-
raise (Unauthorised (
728+
raise (Unauthorised(
729729
'User does not have search permission on "%s.%s"'
730730
% (class_name, key)))
731731

@@ -793,12 +793,9 @@ def get_collection(self, class_name, input):
793793
):
794794
r = {'id': item_id, 'link': class_path + item_id}
795795
if display_props:
796-
for p in display_props:
797-
if self.db.security.hasPermission(
798-
'View', uid, class_name, itemid=item_id, property=p
799-
):
800-
r.update(self.format_item(class_obj.getnode(item_id),
801-
item_id, props=display_props, verbose=verbose))
796+
# format_item does the permission checks
797+
r.update(self.format_item(class_obj.getnode(item_id),
798+
item_id, props=display_props, verbose=verbose))
802799
if r:
803800
result['collection'].append(r)
804801

0 commit comments

Comments
 (0)