diff --git a/ckanext/generalpublic/helper.py b/ckanext/generalpublic/helper.py index 5accabd..28bbd79 100644 --- a/ckanext/generalpublic/helper.py +++ b/ckanext/generalpublic/helper.py @@ -13,15 +13,13 @@ def is_public(packageid): data = {'packageid': packageid} - #TODO: get list of all visibilies that have Ckanmapping false and make them return a false - visibility = tk.get_action('get_package_visibility')({'ignore_auth': True}, data) try: - if visibility.visibility == "Protected": - return False - else: + if visibility.visibility == "Public": return True + else: + return False except: - return True + return False \ No newline at end of file diff --git a/ckanext/generalpublic/templates/package/snippets/resource_item.html b/ckanext/generalpublic/templates/package/snippets/resource_item.html index 891b7b9..aa371ca 100644 --- a/ckanext/generalpublic/templates/package/snippets/resource_item.html +++ b/ckanext/generalpublic/templates/package/snippets/resource_item.html @@ -1,7 +1,7 @@ {% ckan_extends %} {% block resource_item_explore_links %} -{%if h.is_public(pkg.id) %} +{%if h.is_public(pkg.id) or c.userobj%}
  • {% if not is_activity_archive and res.has_views %} @@ -36,7 +36,7 @@ {% endif %} {% else %}
  • - + {{ _('Get Access to this data') }}