You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2010/11/21 15:08:33 UTC

svn commit: r1037455 - /couchdb/trunk/src/couchdb/couch_js_functions.hrl

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.');
             }