summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd.erl
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2009-10-11 05:49:19 +0000
committerJan Lehnardt <jan@apache.org>2009-10-11 05:49:19 +0000
commite3610fa481b5c506ca0b69f49a6f350fce8b3399 (patch)
treeb0050828126b4bf2dda4eb1c977630787d7b0f3a /src/couchdb/couch_httpd.erl
parente3507c9e1bb57986ccffc9324d99bec4d0e4cc58 (diff)
add create_target:true option to _replicate that creates the target database
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@824029 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd.erl')
-rw-r--r--src/couchdb/couch_httpd.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index b4e8793b..70b31d16 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -362,7 +362,9 @@ etag_respond(Req, CurrentEtag, RespFun) ->
RespFun()
end.
-verify_is_server_admin(#httpd{user_ctx=#user_ctx{roles=Roles}}) ->
+verify_is_server_admin(#httpd{user_ctx=UserCtx}) ->
+ verify_is_server_admin(UserCtx);
+verify_is_server_admin(#user_ctx{roles=Roles}) ->
case lists:member(<<"_admin">>, Roles) of
true -> ok;
false -> throw({unauthorized, <<"You are not a server admin.">>})