You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by mi...@apache.org on 2015/07/15 12:18:49 UTC

ddoc-cache commit: updated refs/heads/master to 04c946f

Repository: couchdb-ddoc-cache
Updated Branches:
  refs/heads/master d65a85cf1 -> 04c946f4f


Allow ddoc_cache to open restricted design docs

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

COUCHDB-2738

This closes #1


Project: http://git-wip-us.apache.org/repos/asf/couchdb-ddoc-cache/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-ddoc-cache/commit/04c946f4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-ddoc-cache/tree/04c946f4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-ddoc-cache/diff/04c946f4

Branch: refs/heads/master
Commit: 04c946f4f63bc05a2b566ccc59e78938d517eb24
Parents: d65a85c
Author: Mike Wallace <mi...@apache.org>
Authored: Tue Jun 30 21:51:23 2015 +0100
Committer: Mike Wallace <mi...@apache.org>
Committed: Wed Jul 15 11:13:14 2015 +0100

----------------------------------------------------------------------
 src/ddoc_cache_opener.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-ddoc-cache/blob/04c946f4/src/ddoc_cache_opener.erl
----------------------------------------------------------------------
diff --git a/src/ddoc_cache_opener.erl b/src/ddoc_cache_opener.erl
index 0236921..b76a228 100644
--- a/src/ddoc_cache_opener.erl
+++ b/src/ddoc_cache_opener.erl
@@ -117,10 +117,10 @@ match_newest(Key) ->
     end.
 
 recover_doc(DbName, DDocId) ->
-    fabric:open_doc(DbName, DDocId, [ejson_body]).
+    fabric:open_doc(DbName, DDocId, [ejson_body, ?ADMIN_CTX]).
 
 recover_doc(DbName, DDocId, Rev) ->
-    {ok, [Resp]} = fabric:open_revs(DbName, DDocId, [Rev], [ejson_body]),
+    {ok, [Resp]} = fabric:open_revs(DbName, DDocId, [Rev], [ejson_body, ?ADMIN_CTX]),
     Resp.
 
 recover_validation_funs(DbName) ->