CouchDB-wide read-only access rights

前端 未结 1 509
陌清茗
陌清茗 2020-12-13 07:06

I need to create a CouchDB user which can only read documents from any database but can\'t write any of them. As far as I\'m concerned, it is not what is supported by defaul

相关标签:
1条回答
  • 2020-12-13 07:34

    You will need to put a design doc in each database you want to enforce this rule. The design doc will have to have a 'validation function' that checks for something on the user that says whether they have write access or not.

    Here is a chapter on validation functions form the official CouchDB book.

    And even better, here is a validation function that only let admins modify a doc, and restrict regular users to read-only access. Here you can find an explanation of the function.

    0 讨论(0)
提交回复
热议问题