Skip to content

Instantly share code, notes, and snippets.

@wuhan005
Created October 18, 2022 17:01
Show Gist options
  • Select an option

  • Save wuhan005/fe3365ab81ca5036d923bfd468d9e1f8 to your computer and use it in GitHub Desktop.

Select an option

Save wuhan005/fe3365ab81ca5036d923bfd468d9e1f8 to your computer and use it in GitHub Desktop.
CouchDB read only design document
{
"_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