问题
Can CKAN be used for a website where users only get access to the datasets after login?
I have in mind a site like www.statista.com run with CKAN that gives users access to only a few datasets. Full access is granted after signing in (e.g., to users who are paying for a subscription). Is that possible with CKAN?
If that is possible, does CKAN have its own authentication system or can it be managed with FIWARE Key Rock GE and Access Control GE?
回答1:
CKAN has its own authentication system, but we have developed a extension that allows developers to use some IdM (including the FIWARE one) to authenticate the users. If you want to use this extension you can check the instructions for installing it on https://github.com/conwetlab/ckanext-oauth2
We have also developed another extension to manage the users that can view a specific dataset. However, I think this extension does not fit to your purposes, but you can develop your own extension (as stated by Kapucko). It's very easy, you have to follow the instructions provided on http://docs.ckan.org/en/latest/extensions/tutorial.html.
In your case you will have to implement the IAuthFunctions plugin interface, overwrite the package_show function and return { 'success': True } only when the user is logged in. I seem to remember that this only happens when context.get('auth_user_obj') is not None.
You can also use organizations and create all the datasets within it (setting the Visibility field to Private). Nevertheless, I do not recommend you this approach since you will have to manually insert new users.
回答2:
You can write custom extensions for CKAN, where you can define your custom authentication. A good point where to start is: https://ckan.readthedocs.org/en/latest/maintaining/authorization.html
来源:https://stackoverflow.com/questions/27360247/ckan-with-data-access-only-after-login