ckan的数据限制访问扩展
ckanext-restricted的Python项目详细描述
…您应该在travis-ci.org和covertalls.io上启用此项目,以使这些徽章起作用。已经为您生成了必要的travis和coverage配置文件。图片::https://travis-ci.org/espona/ckanext-restricted.svg?branch=master
:目标:https://travis ci.org/espona/ckanext restricted
…图片::https://coveralls.io/repos/espona/ckanext restricted/badge.svg
:目标:https://coveralls.io/r/espona/ckanext restricted
…图像::https://pypip.in/download/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi//ckanext restricted/
:alt:downloads
。图片::https://pypip.in/version/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi/ckanext restricted/
:alt:latest version
…图片::https://pypip.in/py_versions/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi/ckanext restricted/
:alt:支持的python版本
。图片::https://pypip.in/status/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi/ckanext restricted/
:alt:development status
。图像::https://pypip.in/license/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi/ckanext restricted/
:alt:license
===
==
ckanext restricted
==
……在这里描述一下您的分机:
它是做什么的?它有什么特点?
考虑包括一些截图或嵌入视频!
ckan扩展,用于限制对数据集资源的可访问性。
这样,包元数据是可访问的,而不是数据本身(资源)。
可以为每个包单独定义资源访问限制级别。
用户可以通过按按钮请求访问数据集。包所有者可以
允许单个用户访问资源。
它还包括在每次新用户注册时通过邮件通知。
restricted_resources_metadata.png
restricted_resources_preview.png
图::restricted_resources_preview.png
:align:center
:alt:package view with restricted resources
:figclass:align center
package view with restricted resources
。图::restricted_resources_metadata.png
:align:center
:alt:包含限制配置的资源元数据
:figclass:align center
图::受限资源请求表单.png
:align:center
:alt:受限资源请求表单
:figclass:align center
受限资源请求表单
----
需求
-
此扩展已开发为CKAN 2.5.2版操作。
可以为每个包单独定义资源访问限制级别。这需要在包元数据中添加一个额外的字段,该字段的(某些)可能值为:"public"、"registered"、"any_organization"、"same_organization"(作为包)。
xt scheming和ckanext复合,这是json中的字段定义:
:
{
"scheming_version":1,
"dataset_type":"dataset",
"about":",
"about_url":"http://github.com/ckan/ckanext scheming",
"dataset_fields":[…],
"resource"_字段":[
[…]
{
"字段名":"受限"、
"标签":"访问限制"、
"预置":"合成"、
"子字段":
[
{
"字段名":"级别"、
"标签":"级别"、
预设":"选择",
"表单包含空白选项":假,
"必选":true,
"choices":[
{
"value":"public",
"label":"public"
},
{
"value":"registered",
"label":"registered users"
},
{
"值":"任意组织"、
"标签":"任意组织成员(可信用户)"
}、
{
"值":"同一组织"、
"标签":"同一组织成员"
}
]
}、
{
"字段名":"允许的用户"、
"标签":"允许的用户"、
"预置":"标记字符串自动完成"、
"数据模块源":/api/2/util/user/autocomplete?Q =?"
}
]
}
]
}
在我们的案例中,我们创建了一个名为"可信用户"的组织,其中邮件帐户已被重复检查。因此,此扩展名在每次新用户注册时都会向ckan配置文件中定义的"mail_to"发送一封邮件。要关闭此功能,只需在以下位置注释代码:
https://github.com/espona/ckanext restricted/blob/master/ckanext/restricted/plugin.py l14
-
-
在下面的列表中添加任何其他安装步骤。
例如安装任何非python依赖项或添加任何必需的配置设置。
要安装ckanext restricted:
1。激活您的CKAN虚拟环境,例如::
。/usr/lib/ckan/default/bin/activate
>2。将ckanext restricted python包安装到虚拟环境中::
3。将"restricted"添加到ckan
配置文件中的"ckan.plugins"设置中(默认配置文件位于
`/etc/ckan/default/production.ini```)。
4。重启ckan。例如,如果您在ubuntu上使用apache部署了ckan::
sudo service apache2 reload
----
config settings
----
例如:
重新检查资源之前等待的最小小时数
(可选,默认值:24)。
ckanext.restricted.some_setting=some_default_value
安装ckanext restricted for development,激活ckan virtualenv并执行以下操作:
git clone https://github.com/espona/ckanext restricted.git
cd ckanext restricted
python setup.py development
pip install-r dev requirements.txt
----
运行测试要运行测试,请执行以下操作::
--
noestests--nologcapture--with pylons=test.ini
r/>
nosetests--nologcapture--with pylons=test.ini--with coverage--cover package=ckanext.restricted--cover inclusive--cover erase--cover tests
应在pypi上提供ext restricted,网址为
https://pypi.python.org/pypi/ckanext-restricted。如果该链接不起作用,那么您可以按照以下步骤在pypi上首次注册项目:
1。创建项目的源发行版::
python setup.py sdist
2。注册项目:
python setup.py register
>3。将源发行版上载到pypi::
>4。用
setup.py`文件中的版本号在github上标记项目的第一个版本。例如,如果"setup.py"中的版本号是
0.0.1,那么请执行以下操作:
git tag 0.0.1
git push--tags
---------------------------
发布新版本的ckanext restricted
thon.org/pypi/ckanext restricted.
要向pypi发布新版本,请执行以下步骤:
1。更新"setup.py"文件中的版本号。
有关如何选择版本号的信息,请参见"pep 440<;http://legacy.python.org/dev/peps/pep-0440/"public version identifiers>;`
。创建新版本的源发行版::
>3。将源发行版上载到pypi::
>4。用
setup.py`文件中的版本号在github上标记项目的新版本。例如,如果"setup.py"中的版本号是
0.0.2,则执行以下操作:
git tag 0.0.2
git push--tags
:目标:https://travis ci.org/espona/ckanext restricted
…图片::https://coveralls.io/repos/espona/ckanext restricted/badge.svg
:目标:https://coveralls.io/r/espona/ckanext restricted
…图像::https://pypip.in/download/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi//ckanext restricted/
:alt:downloads
。图片::https://pypip.in/version/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi/ckanext restricted/
:alt:latest version
…图片::https://pypip.in/py_versions/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi/ckanext restricted/
:alt:支持的python版本
。图片::https://pypip.in/status/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi/ckanext restricted/
:alt:development status
。图像::https://pypip.in/license/ckanext restricted/badge.svg
:目标:https://pypi.python.org/pypi/ckanext restricted/
:alt:license
===
==
ckanext restricted
==
……在这里描述一下您的分机:
它是做什么的?它有什么特点?
考虑包括一些截图或嵌入视频!
ckan扩展,用于限制对数据集资源的可访问性。
这样,包元数据是可访问的,而不是数据本身(资源)。
可以为每个包单独定义资源访问限制级别。
用户可以通过按按钮请求访问数据集。包所有者可以
允许单个用户访问资源。
它还包括在每次新用户注册时通过邮件通知。
restricted_resources_metadata.png
restricted_resources_preview.png
图::restricted_resources_preview.png
:align:center
:alt:package view with restricted resources
:figclass:align center
package view with restricted resources
。图::restricted_resources_metadata.png
:align:center
:alt:包含限制配置的资源元数据
:figclass:align center
图::受限资源请求表单.png
:align:center
:alt:受限资源请求表单
:figclass:align center
受限资源请求表单
----
需求
-
此扩展已开发为CKAN 2.5.2版操作。
可以为每个包单独定义资源访问限制级别。这需要在包元数据中添加一个额外的字段,该字段的(某些)可能值为:"public"、"registered"、"any_organization"、"same_organization"(作为包)。
xt scheming和ckanext复合,这是json中的字段定义:
:
{
"scheming_version":1,
"dataset_type":"dataset",
"about":",
"about_url":"http://github.com/ckan/ckanext scheming",
"dataset_fields":[…],
"resource"_字段":[
[…]
{
"字段名":"受限"、
"标签":"访问限制"、
"预置":"合成"、
"子字段":
[
{
"字段名":"级别"、
"标签":"级别"、
预设":"选择",
"表单包含空白选项":假,
"必选":true,
"choices":[
{
"value":"public",
"label":"public"
},
{
"value":"registered",
"label":"registered users"
},
{
"值":"任意组织"、
"标签":"任意组织成员(可信用户)"
}、
{
"值":"同一组织"、
"标签":"同一组织成员"
}
]
}、
{
"字段名":"允许的用户"、
"标签":"允许的用户"、
"预置":"标记字符串自动完成"、
"数据模块源":/api/2/util/user/autocomplete?Q =?"
}
]
}
]
}
在我们的案例中,我们创建了一个名为"可信用户"的组织,其中邮件帐户已被重复检查。因此,此扩展名在每次新用户注册时都会向ckan配置文件中定义的"mail_to"发送一封邮件。要关闭此功能,只需在以下位置注释代码:
https://github.com/espona/ckanext restricted/blob/master/ckanext/restricted/plugin.py l14
-
-
在下面的列表中添加任何其他安装步骤。
例如安装任何非python依赖项或添加任何必需的配置设置。
要安装ckanext restricted:
1。激活您的CKAN虚拟环境,例如::
。/usr/lib/ckan/default/bin/activate
>2。将ckanext restricted python包安装到虚拟环境中::
3。将"restricted"添加到ckan
配置文件中的"ckan.plugins"设置中(默认配置文件位于
`/etc/ckan/default/production.ini```)。
4。重启ckan。例如,如果您在ubuntu上使用apache部署了ckan::
sudo service apache2 reload
----
config settings
----
例如:
重新检查资源之前等待的最小小时数
(可选,默认值:24)。
ckanext.restricted.some_setting=some_default_value
安装ckanext restricted for development,激活ckan virtualenv并执行以下操作:
git clone https://github.com/espona/ckanext restricted.git
cd ckanext restricted
python setup.py development
pip install-r dev requirements.txt
----
运行测试要运行测试,请执行以下操作::
--
noestests--nologcapture--with pylons=test.ini
r/>
nosetests--nologcapture--with pylons=test.ini--with coverage--cover package=ckanext.restricted--cover inclusive--cover erase--cover tests
应在pypi上提供ext restricted,网址为
https://pypi.python.org/pypi/ckanext-restricted。如果该链接不起作用,那么您可以按照以下步骤在pypi上首次注册项目:
1。创建项目的源发行版::
python setup.py sdist
2。注册项目:
python setup.py register
>3。将源发行版上载到pypi::
>4。用
setup.py`文件中的版本号在github上标记项目的第一个版本。例如,如果"setup.py"中的版本号是
0.0.1,那么请执行以下操作:
git tag 0.0.1
git push--tags
---------------------------
发布新版本的ckanext restricted
thon.org/pypi/ckanext restricted.
要向pypi发布新版本,请执行以下步骤:
1。更新"setup.py"文件中的版本号。
有关如何选择版本号的信息,请参见"pep 440<;http://legacy.python.org/dev/peps/pep-0440/"public version identifiers>;`
。创建新版本的源发行版::
>3。将源发行版上载到pypi::
>4。用
setup.py`文件中的版本号在github上标记项目的新版本。例如,如果"setup.py"中的版本号是
0.0.2,则执行以下操作:
git tag 0.0.2
git push--tags