How can I make user creation public but read access private in CouchDB?

 ̄綄美尐妖づ 提交于 2019-12-07 07:56:45

问题


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?


回答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.)

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.

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



来源:https://stackoverflow.com/questions/7711921/how-can-i-make-user-creation-public-but-read-access-private-in-couchdb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!