[ckan-dev] Extension for keeping package public but not resources

lucia.espona at wsl.ch lucia.espona at wsl.ch
Fri Sep 23 11:53:56 UTC 2016


Thanks Mattew,

I just read this mail, that is exactly what I was testing :D
Instead the resource list I will show some message requesting to log in/register and maybe a dummy resource list (same as usual but without links).

I later would like to make possible to define the level of restriction wanted in the resource. For example: 0-public, 1-registered user, 2-user belonging to any organization, 3-belonging to a particular organization(s).

I know that does not go with the "open data" idea, but I am developing an extension in case someone wants to use it when ready: https://github.com/espona/ckanext-restricted (still empty :p).


Best,
Lucia
_________________________________________________________
Dr. Lucia Espona Pernas

Swiss Federal Institute for Forest, Snow and Landscape Research WSL
Hauptgebäaude Labortrakt (HL C21)
Zürcherstrasse 111
8903 Birmensdorf
Switzerland

+41 44 739 28 71 phone direct
+41 44 739 21 11 reception

www.wsl.ch

-----"ckan-dev" <ckan-dev-bounces at lists.okfn.org> wrote: -----
To: CKAN Development Discussions <ckan-dev at lists.okfn.org>
From: Matthew Fullerton 
Sent by: "ckan-dev" 
Date: 22.09.2016 10:12
Subject: Re: [ckan-dev] Extension for keeping package public but not	resources

Hi Lucia,
If you want to just hide the listing of resources when you don't have a logged in user you can do something like this in an extension:

Override template: package/snippets/resources_list.html

{% ckan_extends %}
{% if not c.userobj %}
  {% block resource_list %}
  {% endblock %}
{% endif %}

This should have the effect of overriding the resource list with emptiness only when no user is logged in. I haven't tested it though. And it is (as you seem to be OK with) not secure and merely superficial.

Best,
Matt

--
Matt Fullerton
Software development and data science for open data and mobility
matt at crowdsalad.de
+49 89 7456 0495 / +49 176 5789 6501
http://www.crowdsalad.de 
On 21 September 2016 at 10:25,  <lucia.espona at wsl.ch> wrote:
 Dear all

For my current CKAN instance, I would like the package metadata (description, etc) to be always public, but I would need to restrict the access to the resources (data, files). As a start, it will be enough if the resource data is just accessible to registered users. It doesn't need to be something super secure, I may be enough to just "hide" them.

Does anyone know about extension or developments done in this direction? 

Thanks a lot,
Lucia


_________________________________________________________
Dr. Lucia Espona Pernas

Swiss Federal Institute for Forest, Snow and Landscape Research WSL
Hauptgebäaude Labortrakt (HL C21)
Zürcherstrasse 111
8903 Birmensdorf
Switzerland

+41 44 739 28 71 phone direct
+41 44 739 21 11 reception

www.wsl.ch
_______________________________________________
 ckan-dev mailing list
 ckan-dev at lists.okfn.org
 https://lists.okfn.org/mailman/listinfo/ckan-dev
 Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
 

 
_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160923/2fc2b4c9/attachment-0003.html>


More information about the ckan-dev mailing list