Skip to content

Commit 3a7633d

Browse files
author
Ralf Schlatterbeck
committed
Allow HTMLRequest.batch to filter on other permissions than "View"...
...(e.g. on the new "Search" permission") by adding a "permission" parameter. Thanks to Eli Collins for the patch. Closes issue2550699.
1 parent 4c49043 commit 3a7633d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Features:
1212
- PostgreSQL backend minor improvement: database creation less likely to fail
1313
for PostgreSQL versions >= 8.1 as the table "postgres" is used by default.
1414
Closes issue2550543. Thanks to Kai Storbeck for the patch. (Bernhard Reiter)
15+
- Allow HTMLRequest.batch to filter on other permissions than "View"
16+
(e.g. on the new "Search" permission") by adding a "permission"
17+
parameter. Thanks to Eli Collins for the patch. Closes issue2550699.
1518

1619
Fixed:
1720

roundup/cgi/templating.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ def base_javascript(self):
27182718
</script>
27192719
"""%self.base
27202720

2721-
def batch(self):
2721+
def batch(self, permission='View'):
27222722
""" Return a batch object for results from the "current search"
27232723
"""
27242724
check = self._client.db.security.hasPermission
@@ -2744,7 +2744,7 @@ def batch(self):
27442744

27452745
# filter for visibility
27462746
l = [id for id in klass.filter(matches, filterspec, sort, group)
2747-
if check('View', userid, self.classname, itemid=id)]
2747+
if check(permission, userid, self.classname, itemid=id)]
27482748

27492749
# return the batch object, using IDs only
27502750
return Batch(self.client, l, self.pagesize, self.startwith,

0 commit comments

Comments
 (0)