diff --git a/ckanext/package_group_permissions/helpers.py b/ckanext/package_group_permissions/helpers.py index 5cff74c..97faacb 100755 --- a/ckanext/package_group_permissions/helpers.py +++ b/ckanext/package_group_permissions/helpers.py @@ -33,3 +33,4 @@ def get_all_groups(): return [[group['id'], group['display_name']] for group in groups if group['id'] not in pkg_group_ids] + diff --git a/ckanext/package_group_permissions/plugin.py b/ckanext/package_group_permissions/plugin.py index 97f2a77..c3e4ce5 100755 --- a/ckanext/package_group_permissions/plugin.py +++ b/ckanext/package_group_permissions/plugin.py @@ -37,7 +37,7 @@ def member_create(self, next_auth, context, data_dict): :return: """ authorized = False - if g.controller in ['package', 'dataset'] and g.action in ['groups']: + if g.blueprint in ['package', 'dataset'] and g.view in ['groups']: authorized = helpers.user_has_admin_access(include_editor_access=True) if not authorized: diff --git a/ckanext/package_group_permissions/templates/group/snippets/group_item.html b/ckanext/package_group_permissions/templates/group/snippets/group_item.html index 5f34ef1..c3ab48e 100755 --- a/ckanext/package_group_permissions/templates/group/snippets/group_item.html +++ b/ckanext/package_group_permissions/templates/group/snippets/group_item.html @@ -16,7 +16,7 @@ {% block link %} {{ super() }} {% endblock %} - {% if group.user_member or (h.check_access('member_delete', group) and c.controller in ['package', 'dataset'] and c.action in ['groups']) %} + {% if group.user_member or (h.check_access('member_delete', group) and g.blueprint in ['dataset'] and g.view in ['groups']) %} {% endif %} {% endblock %} diff --git a/ckanext/package_group_permissions/templates/package/group_list.html b/ckanext/package_group_permissions/templates/package/group_list.html index e62fe4b..02812a7 100755 --- a/ckanext/package_group_permissions/templates/package/group_list.html +++ b/ckanext/package_group_permissions/templates/package/group_list.html @@ -12,6 +12,7 @@