You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/10/28 14:56:30 UTC
[GitHub] [couchdb] nickva commented on a change in pull request #2279: Pass
contexts to fabric2_db functions
nickva commented on a change in pull request #2279: Pass contexts to fabric2_db functions
URL: https://github.com/apache/couchdb/pull/2279#discussion_r339610793
##########
File path: src/chttpd/src/chttpd_db.erl
##########
@@ -360,10 +357,10 @@ handle_design_info_req(#httpd{method='GET'}=Req, Db, #doc{} = DDoc) ->
handle_design_info_req(Req, _Db, _DDoc) ->
send_method_not_allowed(Req, "GET").
-create_db_req(#httpd{}=Req, DbName) ->
+create_db_req(#httpd{user_ctx=Ctx}=Req, DbName) ->
couch_httpd:verify_is_server_admin(Req),
DocUrl = absolute_uri(Req, "/" ++ couch_util:url_encode(DbName)),
- case fabric2_db:create(DbName, []) of
+ case fabric2_db:create(DbName, [{user_ctx, Ctx}]) of
Review comment:
In practice this user_ctx is thrown away here. We check for the server admin then we apply the user_ctx in create then strip it away when we insert it into the fabric2_server cache. In testing or other cases it might be nice to create and get the user_ctx already applied though.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services