diff --git a/README.md b/README.md index dd41dc4..d57b521 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # pouchdb-users -> PouchDB plugin to simulate CouchDB’s \_users database behavior +> PouchDB plugin to simulate CouchDB’s \_users database behavior. + +This forked version allows _users behavior to be added to any db while still retaining the ability to add other doc types as well. Only 'user' doc types are validated for _user db behavior. [![Build Status](https://travis-ci.org/hoodiehq/pouchdb-users.svg?branch=master)](https://travis-ci.org/hoodiehq/pouchdb-users) [![Coverage Status](https://coveralls.io/repos/hoodiehq/pouchdb-users/badge.svg?branch=master)](https://coveralls.io/r/hoodiehq/pouchdb-users?branch=master) diff --git a/lib/validate-doc-update.js b/lib/validate-doc-update.js index 875a0e4..572c9c8 100644 --- a/lib/validate-doc-update.js +++ b/lib/validate-doc-update.js @@ -7,16 +7,8 @@ module.exports = function (newDoc, oldDoc, userCtx, secObj) { throw error } - if (newDoc._id.substr(0, 8) === '_design/') { - return - } - - if (newDoc._id.substr(0, 7) === '_local/') { - return - } - if ((oldDoc && oldDoc.type !== 'user') || newDoc.type !== 'user') { - throwError('doc.type must be user') + return } if (!newDoc.name) { diff --git a/package.json b/package.json index 12523e8..aaaa062 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { - "name": "pouchdb-users", + "name": "@inator/pouchdb-users", + "version": "1.0.8", "description": "PouchDB plugin to simulate CouchDB’s _users database behavior", "main": "index.js", "scripts": { @@ -14,7 +15,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/hoodiehq/pouchdb-users.git" + "url": "https://github.com/inator/pouchdb-users" }, "keywords": [ "couchdb", @@ -26,9 +27,9 @@ "author": "The Hoodie Community", "license": "Apache-2.0", "bugs": { - "url": "https://github.com/hoodiehq/pouchdb-users/issues" + "url": "https://github.com/inator/pouchdb-users/issues" }, - "homepage": "https://github.com/hoodiehq/pouchdb-users#readme", + "homepage": "https://github.com/inator/pouchdb-users#readme", "dependencies": { "lie": "^3.1.1", "pouchdb-bulkdocs-wrapper": "^1.0.2",