EnviDat / ckanext-restricted

CKAN extension for restricting access to resources
GNU Affero General Public License v3.0
7 stars 26 forks source link

strange internal server error issue only if there is any attachments (resources) #14

Closed Akshay-Hegde closed 4 years ago

Akshay-Hegde commented 4 years ago

I am on ckan 2.8.3 I just started using ckanext-scheming extension, as per instruction given in https://github.com/ckan/ckanext-scheming, very similar to schema given in https://raw.githubusercontent.com/ckan/ckanext-scheming/master/ckanext/scheming/camel_photos.json

Here is issue, suppose

Its very unfortunate that, if I disable restricted extension in my development.ini, I am able to access dataset http://example.com/camel-photos/foo-dataset even after I logout.

If there is any attachment then I get below error

[Tue Nov 05 14:18:13.723092 2019] [:error] [pid 10452] [remote 192.168.56.1:160] Error - <type 'exceptions.TypeError'>: coercing to Unicode: need string or buffer, NoneType found
[Tue Nov 05 14:18:13.730001 2019] [:error] [pid 10452] [remote 192.168.56.1:160]   log.debug('restricted_package_show ' + resource.get('id','') + ', ' + resource.get('name','') + ' (' + str(resource.get('restricted', '')) + '): ' + str(authorized))
[Tue Nov 05 14:18:13.730012 2019] [:error] [pid 10452] [remote 192.168.56.1:160] TypeError: coercing to Unicode: need string or buffer, NoneType found
Akshay-Hegde commented 4 years ago

I am sorry I could solve issue myself, I used pip install ckanext-restricted which installed 0.0.2, now I used git to install latest release 0.0.4, now working as expected.

Thanks for wonderful extension.