summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_db.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-10-22 03:08:53 +0000
committerDamien F. Katz <damien@apache.org>2008-10-22 03:08:53 +0000
commit50decd4044bb8fcfd22c485e064a11d63fa15a2d (patch)
tree87c984effe7f270ad341bc66a565d5364a5cd505 /src/couchdb/couch_httpd_db.erl
parent561b9852b792bae344ad87b02b14f8e3f712a13e (diff)
First check-in of admin http authentication and authorization.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@706848 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_db.erl')
-rw-r--r--src/couchdb/couch_httpd_db.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index a60686fd..8b8a7df0 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -42,6 +42,7 @@ handle_request(#httpd{path_parts=[DbName|RestParts],method=Method,
end.
create_db_req(Req, DbName) ->
+ ok = couch_httpd:check_is_admin(Req),
case couch_server:create(DbName, []) of
{ok, Db} ->
couch_db:close(Db),
@@ -51,6 +52,7 @@ create_db_req(Req, DbName) ->
end.
delete_db_req(Req, DbName) ->
+ ok = couch_httpd:check_is_admin(Req),
case couch_server:delete(DbName) of
ok ->
send_json(Req, 200, {[{ok, true}]});