summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-02-24 15:37:16 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-02-24 15:37:16 +0000
commit838208cde9cac38299ae7ef108c9c468c50c28f7 (patch)
tree5dee6ec1a3c3d5031ac386e85de73c4cd9e79998 /share
parentadf10a62ec14da5a354f03fed055f14d292961e8 (diff)
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
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/reader_acl.js16
1 files changed, 16 insertions, 0 deletions
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();