开发者

Serverside - CouchDB only

Couple days ago, I stumbled to CouchDB. I liked it immediately, one of the reason 开发者_如何学Pythonwas because it's REST! So, next day, I was thinking about security. I saw there is /_session, for authentication.

But still, there is one major thing I'm thinking about, and that's filtering requests and data. So, lets say /users/ gets list of all users. If ROLE is ADMIN, then it should get all data, but if ROLE is something else, then lets say it should only send username and email, but not other data. Is this possible with CouchDB?

Thanks!


Yes, it is possible to do this. List and Show functions have access to information about the user's request, so if they are authenticated as an Administrator you can change the output of the request.

See:

  1. http://guide.couchdb.org/draft/transforming.html#arguments
  2. http://wiki.apache.org/couchdb/Formatting_with_Show_and_List
  3. http://blog.couchone.com/post/1027100082/whats-new-in-couchdb-1-0-part-4-securityn-stuff
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜