summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_db.erl
diff options
context:
space:
mode:
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}]});