couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikewall...@apache.org
Subject couch-index commit: updated refs/heads/master to cc7850c
Date Wed, 15 Jul 2015 10:19:31 GMT
Repository: couchdb-couch-index
Updated Branches:
  refs/heads/master 13fed1ed2 -> cc7850c6d


Allow couch_index to open restricted design docs

Design docs in the authentication DB cannot be opened without an
admin context so this commit teaches couch_index to always use
?ADMIN_CTX when opening documents.

COUCHDB-2738

This closes #6


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/commit/cc7850c6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/tree/cc7850c6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/diff/cc7850c6

Branch: refs/heads/master
Commit: cc7850c6d15125fd8e1c7e4969e4bf76a140c6b0
Parents: 13fed1e
Author: Mike Wallace <mikewallace@apache.org>
Authored: Tue Jun 30 21:52:58 2015 +0100
Committer: Mike Wallace <mikewallace@apache.org>
Committed: Wed Jul 15 11:14:52 2015 +0100

----------------------------------------------------------------------
 src/couch_index.erl        | 2 +-
 src/couch_index_server.erl | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/cc7850c6/src/couch_index.erl
----------------------------------------------------------------------
diff --git a/src/couch_index.erl b/src/couch_index.erl
index a554c0e..fa08dd1 100644
--- a/src/couch_index.erl
+++ b/src/couch_index.erl
@@ -283,7 +283,7 @@ handle_cast(ddoc_updated, State) ->
     DbName = Mod:get(db_name, IdxState),
     DDocId = Mod:get(idx_name, IdxState),
     Shutdown = couch_util:with_db(DbName, fun(Db) ->
-        case couch_db:open_doc(Db, DDocId, [ejson_body]) of
+        case couch_db:open_doc(Db, DDocId, [ejson_body, ?ADMIN_CTX]) of
             {not_found, deleted} ->
                 true;
             {ok, DDoc} ->

http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/cc7850c6/src/couch_index_server.erl
----------------------------------------------------------------------
diff --git a/src/couch_index_server.erl b/src/couch_index_server.erl
index 4b60a39..42a122b 100644
--- a/src/couch_index_server.erl
+++ b/src/couch_index_server.erl
@@ -73,7 +73,7 @@ get_index(Module, #db{name = <<"shards/", _/binary>> = DbName},
DDoc) ->
     end;
 get_index(Module, <<"shards/", _/binary>> = DbName, DDoc) ->
     {Pid, Ref} = spawn_monitor(fun() ->
-        exit(fabric:open_doc(mem3:dbname(DbName), DDoc, [ejson_body]))
+        exit(fabric:open_doc(mem3:dbname(DbName), DDoc, [ejson_body, ?ADMIN_CTX]))
     end),
     receive {'DOWN', Ref, process, Pid, {ok, Doc}} ->
         get_index(Module, DbName, Doc, nil);
@@ -93,7 +93,7 @@ get_index(Module, DbName, DDoc, Fun) when is_binary(DbName) ->
         get_index(Module, Db, DDoc, Fun)
     end);
 get_index(Module, Db, DDoc, Fun) when is_binary(DDoc) ->
-    case couch_db:open_doc(Db, DDoc, [ejson_body]) of
+    case couch_db:open_doc(Db, DDoc, [ejson_body, ?ADMIN_CTX]) of
         {ok, Doc} -> get_index(Module, Db, Doc, Fun);
         Error -> Error
     end;


Mime
View raw message