Skip to content

Commit

Permalink
fix: allow saving _design docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Dec 21, 2015
1 parent d9dd147 commit 0694641
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/validate-doc-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ module.exports = function (newDoc, oldDoc, userCtx, secObj) {
throw error
}

if (newDoc._id.substr(0, 8) === '_design/') {
return
}

if ((oldDoc && oldDoc.type !== 'user') || newDoc.type !== 'user') {
throwError('doc.type must be user')
} // we only allow user docs for now
}

if (!newDoc.name) {
throwError('doc.name is required')
Expand Down

0 comments on commit 0694641

Please sign in to comment.