Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Commit

Permalink
Merge branch '1888-fix-user-fields-disabled-for-admins'
Browse files Browse the repository at this point in the history
* 1888-fix-user-fields-disabled-for-admins:
  admins can always read all doc fields, regardless of public_fields
  • Loading branch information
janl committed Oct 3, 2013
2 parents 45f88b4 + 4f267df commit c861f2d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions script/test/users_db_security.js
Expand Up @@ -168,7 +168,7 @@ couchTests.users_db_security = function(debug) {
"should not_found opening another user's user doc");


// save a db amin
// save a db admin
var benoitcDoc = {
_id: "org.couchdb.user:benoitc",
type: "user",
Expand Down Expand Up @@ -320,7 +320,7 @@ couchTests.users_db_security = function(debug) {
{
section: "couch_httpd_auth",
key: "public_fields",
value: "name,type"
value: "name"
},
{
section: "couch_httpd_auth",
Expand All @@ -342,6 +342,13 @@ couchTests.users_db_security = function(debug) {
TEquals("forbidden", e.error, "should throw");
}

// COUCHDB-1888 make sure admins always get all fields
TEquals(true, CouchDB.login("jan", "apple").ok);
var all_admin = usersDb.allDocs({ include_docs: "true" });
TEquals("user", all_admin.rows[2].doc.type,
"should return type");


// log in one last time so run_on_modified_server can clean up the admin account
TEquals(true, CouchDB.login("jan", "apple").ok);
});
Expand Down

0 comments on commit c861f2d

Please sign in to comment.