问题
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