couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "Document_Update_Validation" by MarcelloNuccio
Date Tue, 20 Sep 2011 13:09:18 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Document_Update_Validation" page has been changed by MarcelloNuccio:
http://wiki.apache.org/couchdb/Document_Update_Validation?action=diff&rev1=5&rev2=6

Comment:
Documented fourth parameter of validate_doc_update()

  {{{#!highlight javascript
  {
     "_id": "_design/myview",
-    "validate_doc_update": "function(newDoc, oldDoc, userCtx) {
+    "validate_doc_update": "function(newDoc, oldDoc, userCtx, secObj) {
        if(newDoc.address === undefined) {
           throw {forbidden: 'Document must have an address.'};
        }"
@@ -37, +37 @@

    a. db - String name of database
    a. name - String user name
    a. roles - Array of roles to which user belongs. Currently only admin role is supported.
+  1. secObj - The security object of the database (introduced in CouchDB-0.11.1).
  
  == Toolbox ==
  Some of these functions are found in http://guide.couchdb.org/draft/validation.html . Use
them inside your validate_doc_update functions.

Mime
View raw message