summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_db.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-11-17 18:18:51 +0000
committerDamien F. Katz <damien@apache.org>2008-11-17 18:18:51 +0000
commitaee6f18edf8cdf3f7c09c93fcf1af48c2c15fcd8 (patch)
treefd3a259ba4b0edd2c9ea5e6657f0ae314b36cbb5 /src/couchdb/couch_httpd_db.erl
parentd32d8acff4bac6f51b87ddef7091c04ff7245d40 (diff)
More security and validation work. Still incomplete.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@718311 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_db.erl')
-rw-r--r--src/couchdb/couch_httpd_db.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index bc8e2019..a239ceb5 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -41,9 +41,9 @@ handle_request(#httpd{path_parts=[DbName|RestParts],method=Method,
do_db_req(Req, Handler)
end.
-create_db_req(Req, DbName) ->
+create_db_req(#httpd{user_ctx=UserCtx}=Req, DbName) ->
ok = couch_httpd:check_is_admin(Req),
- case couch_server:create(DbName, [{creds, couch_httpd:creds(Req)}]) of
+ case couch_server:create(DbName, [{user_ctx, UserCtx}]) of
{ok, Db} ->
couch_db:close(Db),
send_json(Req, 201, {[{ok, true}]});
@@ -51,17 +51,17 @@ create_db_req(Req, DbName) ->
throw(Error)
end.
-delete_db_req(Req, DbName) ->
+delete_db_req(#httpd{user_ctx=UserCtx}=Req, DbName) ->
ok = couch_httpd:check_is_admin(Req),
- case couch_server:delete(DbName, [{creds, couch_httpd:creds(Req)}]) of
+ case couch_server:delete(DbName, [{user_ctx, UserCtx}]) of
ok ->
send_json(Req, 200, {[{ok, true}]});
Error ->
throw(Error)
end.
-do_db_req(#httpd{path_parts=[DbName|_]}=Req, Fun) ->
- case couch_db:open(DbName, [{creds, couch_httpd:creds(Req)}]) of
+do_db_req(#httpd{user_ctx=UserCtx,path_parts=[DbName|_]}=Req, Fun) ->
+ case couch_db:open(DbName, [{user_ctx, UserCtx}]) of
{ok, Db} ->
try
Fun(Req, Db)