From 6d0cdd8696df15843e37844a22da1cc4a15ed158 Mon Sep 17 00:00:00 2001 From: schlatterbeck Date: Fri, 15 Jul 2011 14:13:51 +0000 Subject: [PATCH] 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. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4636 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 3 +++ roundup/cgi/templating.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d2ff695..76f9b5e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -12,6 +12,9 @@ Features: - PostgreSQL backend minor improvement: database creation less likely to fail for PostgreSQL versions >= 8.1 as the table "postgres" is used by default. Closes issue2550543. Thanks to Kai Storbeck for the patch. (Bernhard Reiter) +- 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. Fixed: diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 04cfd76..b0eaf02 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -2718,7 +2718,7 @@ function help_window(helpurl, width, height) { """%self.base - def batch(self): + def batch(self, permission='View'): """ Return a batch object for results from the "current search" """ check = self._client.db.security.hasPermission @@ -2744,7 +2744,7 @@ function help_window(helpurl, width, height) { # filter for visibility l = [id for id in klass.filter(matches, filterspec, sort, group) - if check('View', userid, self.classname, itemid=id)] + if check(permission, userid, self.classname, itemid=id)] # return the batch object, using IDs only return Batch(self.client, l, self.pagesize, self.startwith, -- 2.30.2