couchbaselabs/sync_gateway — pull request #22 by jchris (2013-02-15 18:57:33+00:00)
Title: Access call in channelmapper

I was able to get this to work with my old build of the wiki, just by using this sync function:

```javascript
function channelMap(doc) {
var ch = doc.wiki_id;
if (ch) {
sync("ch-"+ch);
}
if (doc.owner_id) {
sync("threads");
access(doc.owner_id, "ch-"+doc._id)
access(doc.owner_id, "threads-"+doc.owner_id)
sync("threads-"+doc.owner_id);
ms = doc.members
if (ms) {
for (i = ms.length - 1; i >= 0; i--) {
if (ms[i]) {
access(ms[i], "ch-"+doc._id)
sync("threads-"+ms[i]);
}
}
}
}
}
```