[ckan-changes] commit/ckanextiati: amercader: Extra authz check when writing CSV files

Bitbucket commits-noreply at bitbucket.org
Tue Oct 25 11:51:21 UTC 2011


1 new commit in ckanextiati:


https://bitbucket.org/okfn/ckanextiati/changeset/3b5c05b70b3f/
changeset:   3b5c05b70b3f
branch:      spreadsheet-support
user:        amercader
date:        2011-10-25 13:51:12
summary:     Extra authz check when writing CSV files
affected #:  1 file

diff -r bcce1271991f7e30d61cde415612a0bd427228d1 -r 3b5c05b70b3f319d4b680700ec2cae2551de95c0 ckanext/iati/controllers/spreadsheet.py
--- a/ckanext/iati/controllers/spreadsheet.py
+++ b/ckanext/iati/controllers/spreadsheet.py
@@ -133,8 +133,11 @@
 
             packages.sort()
             for pkg in packages:
-
-                package = get_action('package_show_rest')(context,{'id':pkg})
+                try:
+                    package = get_action('package_show_rest')(context,{'id':pkg})
+                except NotAuthorized:
+                    log.warn('User %s not authorized to read package %s' % (c.user, pkg))
+                    continue
                 if package:
                     row = {}
                     for fieldname, entity, key in self.csv_mapping:

Repository URL: https://bitbucket.org/okfn/ckanextiati/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list