You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2017/07/13 16:28:19 UTC

[couchdb] 01/04: Pass UserCtx to fabric's all_docs from mango query

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit d909cd2128f2ebba333cedf6cfe3d49e9ad573ed
Author: Eric Avdey <ei...@eiri.ca>
AuthorDate: Fri Jun 30 15:37:49 2017 -0300

    Pass UserCtx to fabric's all_docs from mango query
---
 src/mango/src/mango_cursor_view.erl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mango/src/mango_cursor_view.erl b/src/mango/src/mango_cursor_view.erl
index e97311c..4763277 100644
--- a/src/mango/src/mango_cursor_view.erl
+++ b/src/mango/src/mango_cursor_view.erl
@@ -85,11 +85,14 @@ execute(#cursor{db = Db, index = Idx} = Cursor0, UserFun, UserAcc) ->
                 end_key = mango_idx:end_key(Idx, Cursor#cursor.ranges),
                 include_docs = true
             },
-            Args = apply_opts(Cursor#cursor.opts, BaseArgs),
+            #cursor{opts = Opts} = Cursor,
+            Args = apply_opts(Opts, BaseArgs),
+            UserCtx = couch_util:get_value(user_ctx, Opts, #user_ctx{}),
+            DbOpts = [{user_ctx, UserCtx}],
             Result = case mango_idx:def(Idx) of
                 all_docs ->
                     CB = fun ?MODULE:handle_all_docs_message/2,
-                    fabric:all_docs(Db, CB, Cursor, Args);
+                    fabric:all_docs(Db, DbOpts, CB, Cursor, Args);
                 _ ->
                     CB = fun ?MODULE:handle_message/2,
                     % Normal view

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.