Created
October 18, 2022 17:01
-
-
Save wuhan005/fe3365ab81ca5036d923bfd468d9e1f8 to your computer and use it in GitHub Desktop.
CouchDB read only design document
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "_id": "_design/_auth", | |
| "language": "javascript", | |
| "validate_doc_update": "function(newDoc, oldDoc, userCtx, secObj) { if(userCtx.roles.indexOf('_admin') !== -1){ return true; } else { throw({forbidden : 'read only'}); } }" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment