只有登录后才能访问数据的CKAN [英] CKAN with data access only after login
问题描述
可以将CKAN用于仅在用户登录后才能访问数据集的网站吗?
Can CKAN be used for a website where users only get access to the datasets after login?
我想到了像 www.statista.com 这样的网站,该网站与CKAN一起运行,使用户只能访问少数数据集.登录后(例如,向付费订阅的用户)授予完全访问权限.CKAN有可能吗?
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?
如果可能的话,CKAN是否拥有自己的身份验证系统,或者可以使用FIWARE Key Rock GE和Access Control GE进行管理?
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?
推荐答案
CKAN拥有自己的身份验证系统,但我们已经开发了一种扩展,该扩展允许开发人员使用某些IdM(包括FIWARE一个)来对用户进行身份验证.如果要使用此扩展,可以查看在 https://github.com/conwetlab上安装该扩展的说明./ckanext-oauth2
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
我们还开发了另一个扩展来管理可以查看特定数据集的用户.但是,我认为此扩展名不适合您的目的,但是您可以开发自己的扩展名(如Kapucko所述).这很容易,您必须按照 http://docs.ckan上提供的说明进行操作..org/en/latest/extensions/tutorial.html .
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.
在您的情况下,您将必须实现 IAuthFunctions
插件接口,覆盖 package_show
函数并返回 {'success':True}
仅当用户登录时.我似乎记得这仅在 context.get('auth_user_obj')不是None
时发生.
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
.
您还可以使用组织并在其中创建所有数据集(将 Visibility
字段设置为 Private
).但是,我不建议您使用这种方法,因为您将不得不手动插入新用户.
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.
这篇关于只有登录后才能访问数据的CKAN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!