From 838208cde9cac38299ae7ef108c9c468c50c28f7 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Wed, 24 Feb 2010 15:37:16 +0000 Subject: replicator and view generator can skip check_is_reader when opening database files git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@915827 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/reader_acl.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'share') diff --git a/share/www/script/test/reader_acl.js b/share/www/script/test/reader_acl.js index 6f834bfb..a42e9bea 100644 --- a/share/www/script/test/reader_acl.js +++ b/share/www/script/test/reader_acl.js @@ -90,10 +90,26 @@ couchTests.reader_acl = function(debug) { // server _admin can always read T(secretDb.open("baz").foo == "bar"); + // and run temp views + TEquals(secretDb.query(function(doc) { + emit(null, null) + }).total_rows, 1); + + T(secretDb.save({ + "_id" : "_design/foo", + views : { + bar : { + map : "function(doc){emit(null, null)}" + } + } + }).ok) + // now top-secret users can read too T(CouchDB.login("jchris@apache.org", "funnybone").ok); T(CouchDB.session().userCtx.roles.indexOf("_admin") == -1); T(secretDb.open("baz").foo == "bar"); + // readers can query stored views + T(secretDb.view("foo/bar").total_rows == 1); CouchDB.logout(); -- cgit v1.2.3