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 "Security Features Overview" by SamuelWan
Date Tue, 21 Apr 2009 00:22:37 GMT
Dear Wiki user,

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

The following page has been changed by SamuelWan:
http://wiki.apache.org/couchdb/Security_Features_Overview

------------------------------------------------------------------------------
  CouchDB does not support other roles at this time. Support for read access restriction is
planned for the 1.0 release. 
  
  === Validation ===
- A design document may define a member function called "validate_doc_update". Any request
to create or update a document must first pass through each "validate_doc_update" function
defined in each design document. The validation functions are executed in an unspecified order.
A design document can contain only one validation function.
+ A design document may define a member function called "validate_doc_update". Requests to
create or update a document are validated against every "validate_doc_update" function defined
in the database. The validation functions are executed in an unspecified order. A design document
can contain only one validation function. Errors are thrown as javascript objects. 
  
  Example of a design document that validates the presence of an "address" field and returns
:
  
@@ -47, +47 @@

  {"error":"missing_field","reason":"Document must have an address."} 
  }}}
  
+ 
+ The "validate_doc_update" function accepts three arguments:
+  1. newDoc - The document to be created or used for update.
+  1. oldDoc - The current document if document id was specified in the HTTP request
+  1. userCtx - User context object, which contains three properties:
+    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.
+ 

Mime
View raw message