Mercurial > p > roundup > code
changeset 4524:68bbefb72825
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.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Fri, 15 Jul 2011 14:13:51 +0000 |
| parents | a03646a02f68 |
| children | ef9c5558ef12 |
| files | CHANGES.txt roundup/cgi/templating.py |
| diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Fri Jul 15 14:05:29 2011 +0000 +++ b/CHANGES.txt Fri Jul 15 14:13:51 2011 +0000 @@ -12,6 +12,9 @@ - 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:
--- a/roundup/cgi/templating.py Fri Jul 15 14:05:29 2011 +0000 +++ b/roundup/cgi/templating.py Fri Jul 15 14:13:51 2011 +0000 @@ -2718,7 +2718,7 @@ </script> """%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 @@ # 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,
