diff options
author | Jan Lehnardt <jan@apache.org> | 2009-10-15 12:55:48 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2009-10-15 12:55:48 +0000 |
commit | c91b2eb4a57b760f07b3d8e93a9b7aa2f0820e4c (patch) | |
tree | 4efb3e952adca906f516f896aa544d91868d38f1 /src/couchdb/couch_rep.erl | |
parent | bc3b258fe7ae3ffee555a348066887dbe1bce8b6 (diff) |
Only check for admin user if we are trying to create a database. Thanks to Bob Dionne for testing the patch.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@825485 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_rep.erl')
-rw-r--r-- | src/couchdb/couch_rep.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl index 1a894523..e7833d15 100644 --- a/src/couchdb/couch_rep.erl +++ b/src/couchdb/couch_rep.erl @@ -462,9 +462,10 @@ open_db(<<"http://",_/binary>>=Url, _, CreateTarget) -> open_db(<<"https://",_/binary>>=Url, _, CreateTarget) -> open_db({[{<<"url">>,Url}]}, [], CreateTarget); open_db(<<DbName/binary>>, UserCtx, CreateTarget) -> - ok = couch_httpd:verify_is_server_admin(UserCtx), case CreateTarget of - true -> couch_server:create(DbName, [{user_ctx, UserCtx}]); + true -> + ok = couch_httpd:verify_is_server_admin(UserCtx), + couch_server:create(DbName, [{user_ctx, UserCtx}]); false -> ok end, |