couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r960084 - /couchdb/trunk/src/couchdb/couch_js_functions.hrl
Date Fri, 02 Jul 2010 18:39:15 GMT
Author: jchris
Date: Fri Jul  2 18:39:15 2010
New Revision: 960084

URL: http://svn.apache.org/viewvc?rev=960084&view=rev
Log:
fix edge case in users db validation fun

Modified:
    couchdb/trunk/src/couchdb/couch_js_functions.hrl

Modified: couchdb/trunk/src/couchdb/couch_js_functions.hrl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_js_functions.hrl?rev=960084&r1=960083&r2=960084&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_js_functions.hrl (original)
+++ couchdb/trunk/src/couchdb/couch_js_functions.hrl Fri Jul  2 18:39:15 2010
@@ -12,9 +12,9 @@
 
 -define(AUTH_DB_DOC_VALIDATE_FUNCTION, <<"
     function(newDoc, oldDoc, userCtx) {
-        if ((oldDoc || newDoc).type !== 'user') {
+        if ((oldDoc && oldDoc.type !== 'user') || newDoc.type !== 'user') {
             throw({forbidden : 'doc.type must be user'});
-        } // we only validate user docs for now
+        } // we only allow user docs for now
 
         if (newDoc._deleted === true) {
             // allow deletes by admins and matching users



Mime
View raw message