如何在CouchDB中公开创建用户,但公开读取访问权限? [英] How can I make user creation public but read access private in CouchDB?

查看:106
本文介绍了如何在CouchDB中公开创建用户,但公开读取访问权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想公开创建用户,以便未经身份验证的用户可以在 _users 中创建新帐户,但仅授予 admin读取权限角色。这可能吗?

I'd like to make user creation public, so that unauthenticated users can create new accounts in _users, but only give read privileges to admin roles. Is this possible? How?

推荐答案

CouchDB 1.1.0和即将发布的1.1.1不支持此功能。最好的办法是拥有一个公共数据库,用户可以在其中提交创建用户帐户的请求,还可以使用一个独立的工具来对此做出反应并创建普通用户帐户。 (独立工具可以只是您以管理员身份登录的专用网页。)

CouchDB 1.1.0 and the upcoming 1.1.1 do not support this. The best you can do is to have a public database where users submit requests to create user accounts, and you have a standalone tool to react to that and create normal user accounts. (The standalone tool could simply be a dedicated web page you log in to as the admin.)

我已经提交了补丁,以完全按照您的描述进行操作。称为 CouchDB收件箱数据库,它允许无特权的用户将一些已批准的文档写入到数据库,但他们无法读取任何数据。创建新用户帐户正是我制作补丁的原因。

I have submitted a patch to do exactly what you describe. Called the CouchDB inbox database, it allows unprivileged users to write some approved documents to the database, but they cannot read any of the data. Creating new user accounts is exactly why I made the patch.

我很乐观地将其包含在v1.2或1.3中。

I am optimistic that it will be included in either v1.2 or 1.3.

这篇关于如何在CouchDB中公开创建用户,但公开读取访问权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆