Skip to content

Commit

Permalink
Fix authz imports
Browse files Browse the repository at this point in the history
According to ckan/ckan#2818, ckan.new_authz is deprecated. 
This fix is similar to 40bf2d7
  • Loading branch information
rbvictor committed Jul 5, 2016
1 parent 57e486c commit 4cf0e9a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ckanext/privatedatasets/auth.py
Expand Up @@ -20,7 +20,10 @@
import ckan.lib.helpers as helpers
import ckan.logic.auth as logic_auth
import ckan.plugins.toolkit as tk
import ckan.new_authz as new_authz
try:
import ckan.authz as authz
except ImportError:
import ckan.new_authz as authz
import db

from ckan.common import _, request
Expand All @@ -44,7 +47,7 @@ def package_show(context, data_dict):

# if the user has rights to read in the organization or in the group
if package.owner_org:
authorized = new_authz.has_user_permission_for_group_or_org(
authorized = authz.has_user_permission_for_group_or_org(
package.owner_org, user, 'read')
else:
authorized = False
Expand Down Expand Up @@ -89,7 +92,7 @@ def package_update(context, data_dict):

# if the user has rights to update a dataset in the organization or in the group
if package and package.owner_org:
authorized = new_authz.has_user_permission_for_group_or_org(
authorized = authz.has_user_permission_for_group_or_org(
package.owner_org, user, 'update_dataset')
else:
authorized = False
Expand Down

0 comments on commit 4cf0e9a

Please sign in to comment.