Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Open global changes db with admin context
The global changes feed should work even if the security object says otherwise.

BugzID: 43665
  • Loading branch information
rnewson committed Jan 23, 2015
1 parent 3400679 commit 60831fef4a92fe6b95e0d4a42690f1f603867cc1
Showing 1 changed file with 2 additions and 1 deletion.
@@ -36,6 +36,7 @@
-include_lib("couch/include/couch_db.hrl").
-include_lib("mem3/include/mem3.hrl").

-define(ADMIN_CTX, {user_ctx, #user_ctx{roles = [<<"_admin">>]}}).

-record(state, {
update_db,
@@ -151,7 +152,7 @@ flush_updates(State) ->
try group_ids_by_shard(State#state.dbname, DocIds) of
GroupedIds ->
Docs = dict:fold(fun(ShardName, Ids, DocInfoAcc) ->
{ok, Shard} = couch_db:open(ShardName, []),
{ok, Shard} = couch_db:open(ShardName, [?ADMIN_CTX]),
try
GroupedDocs = get_docs_locally(Shard, Ids),
GroupedDocs ++ DocInfoAcc

0 comments on commit 60831fe

Please sign in to comment.