diff options
-rw-r--r-- | share/www/script/test/reader_acl.js | 5 | ||||
-rw-r--r-- | src/couchdb/couch_db.erl | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/share/www/script/test/reader_acl.js b/share/www/script/test/reader_acl.js index a42e9bea..d173d701 100644 --- a/share/www/script/test/reader_acl.js +++ b/share/www/script/test/reader_acl.js @@ -41,6 +41,11 @@ couchTests.reader_acl = function(debug) { names : ["joe","barb"] } }).ok); + + usersDb.ensureFullCommit(); + // security changes will always commit synchronously + restartServer(); + // can't read it as jchris T(CouchDB.login("jchris@apache.org", "funnybone").ok); T(CouchDB.session().userCtx.name == "jchris@apache.org"); diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl index e5635f55..4fca1346 100644 --- a/src/couchdb/couch_db.erl +++ b/src/couchdb/couch_db.erl @@ -291,7 +291,9 @@ get_security(#db{security=SecProps}) -> set_security(#db{update_pid=Pid}=Db, {NewSecProps}) when is_list(NewSecProps) -> check_is_admin(Db), ok = validate_security_object(NewSecProps), - gen_server:call(Pid, {set_security, NewSecProps}, infinity); + ok = gen_server:call(Pid, {set_security, NewSecProps}, infinity), + {ok, _} = ensure_full_commit(Db), + ok; set_security(_, _) -> throw(bad_request). |