couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1037455 - /couchdb/trunk/src/couchdb/couch_js_functions.hrl
Date Sun, 21 Nov 2010 14:08:33 GMT
Author: fdmanana
Date: Sun Nov 21 14:08:33 2010
New Revision: 1037455

URL: http://svn.apache.org/viewvc?rev=1037455&view=rev
Log:
Add proper validation of user_ctx.roles for replication documents.

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=1037455&r1=1037454&r2=1037455&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_js_functions.hrl (original)
+++ couchdb/trunk/src/couchdb/couch_js_functions.hrl Sun Nov 21 14:08:33 2010
@@ -121,8 +121,7 @@
                     'non-empty string.');
             }
 
-            if ((typeof user_ctx.roles !== 'undefined') &&
-                    (typeof user_ctx.roles.length !== 'number')) {
+            if (user_ctx.roles && !isArray(user_ctx.roles)) {
                 reportError('The roles property of the user_ctx must be ' +
                     'an array of strings.');
             }



Mime
View raw message