有什么方法可以禁用ckan中的用户自动注册?
我希望有一个ckan网站,该网站对访问者严格来说是只读的
以及供贡献者专用的后端。
我浏览了文档,但找不到类似的任何选项。
任何有关如何为此目的配置和保护ckan的建议都将受到欢迎
最简单的解决方案是编写实现该IAuthFunctions
接口并覆盖user_create
auth函数的扩展。
这是基本扩展名:
def no_registering(context, data_dict):
return {'success': False, 'msg': toolkit._('''You cannot register for this
site.''')}
class NoSelfRegistration(plugins.SingletonPlugin):
plugins.implements(plugins.IAuthFunctions, inherit=True)
def get_auth_functions(self):
return {
'user_create': no_registering
}
更新:我们当前正在实现一个配置选项来执行此操作(请访问https://github.com/okfn/ckan/pull/399的请求)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句