diff options
author | Damien F. Katz <damien@apache.org> | 2008-11-11 19:45:50 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2008-11-11 19:45:50 +0000 |
commit | 9044fc0234ed65056f087a86c7c117922f2a2c75 (patch) | |
tree | ea87133de1e3617c5d3d7366983b7f7039d6cffd /src/couchdb/couch_httpd_db.erl | |
parent | 538f455f2e2842d5caa33ed300d28b3cd52599b3 (diff) |
Check in of initial validation and authorization work. This work is incomplete, as there is not yet any way of restricting who can update the design docs.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@713132 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_db.erl')
-rw-r--r-- | src/couchdb/couch_httpd_db.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index 8b8a7df0..bc8e2019 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -43,7 +43,7 @@ handle_request(#httpd{path_parts=[DbName|RestParts],method=Method, create_db_req(Req, DbName) -> ok = couch_httpd:check_is_admin(Req), - case couch_server:create(DbName, []) of + case couch_server:create(DbName, [{creds, couch_httpd:creds(Req)}]) of {ok, Db} -> couch_db:close(Db), send_json(Req, 201, {[{ok, true}]}); @@ -53,7 +53,7 @@ create_db_req(Req, DbName) -> delete_db_req(Req, DbName) -> ok = couch_httpd:check_is_admin(Req), - case couch_server:delete(DbName) of + case couch_server:delete(DbName, [{creds, couch_httpd:creds(Req)}]) of ok -> send_json(Req, 200, {[{ok, true}]}); Error -> @@ -61,7 +61,7 @@ delete_db_req(Req, DbName) -> end. do_db_req(#httpd{path_parts=[DbName|_]}=Req, Fun) -> - case couch_db:open(DbName, []) of + case couch_db:open(DbName, [{creds, couch_httpd:creds(Req)}]) of {ok, Db} -> try Fun(Req, Db) @@ -129,7 +129,7 @@ db_req(#httpd{method='POST',path_parts=[_,<<"_bulk_docs">>]}=Req, Db) -> _ -> [] end, Docs = [couch_doc:from_json_obj(JsonObj) || JsonObj <- DocsArray], - ok = couch_db:save_docs(Db, Docs, Options), + ok = couch_db:update_docs(Db, Docs, Options, false), send_json(Req, 201, {[ {ok, true} ]}) |