2015-10-09T17:21:11.802+05:30 HTTP: #078: POST /cwlite/_changes
2015-10-09T17:21:12.176+05:30 HTTP: #079: POST /cwlite/_revs_diff
2015-10-09T17:21:17.267+05:30 HTTP: #080: PUT /cwlite/_local/d9e245ab48ca3a8cfb9850e9f3e27de8837caf84
2015-10-09T17:21:31.481+05:30 HTTP: #081: POST /cwlite/_revs_diff
2015-10-09T17:21:31.558+05:30 HTTP: #082: POST /cwlite/_bulk_docs
2015/10/09 17:21:31 JS: cust4
2015/10/09 17:21:31 JS: cust4-ticketOjEIn
2015/10/09 17:21:31 JS: cust4
2015-10-09T17:21:31.559+05:30 CRUD: Doc "cust4-ticketOjEIn" in channels "{ticket-cust4-ticketOjEIn}"
2015-10-09T17:21:31.559+05:30 Access: Doc "cust4-ticketOjEIn" grants channel access: map[cust4:ticket-cust4-ticketOjEIn:23]
2015-10-09T17:21:31.559+05:30 CRUD: Stored doc "cust4-ticketOjEIn" / "1-ef8e7598e8d7f1af301e9a4257c346a4"
2015-10-09T17:21:31.559+05:30 Access: Rev "cust4-ticketOjEIn"/"1-ef8e7598e8d7f1af301e9a4257c346a4" invalidates channels of [cust4]
2015-10-09T17:21:31.559+05:30 Access: Invalidate access of "cust4"
Issue is "Access: Invalidate access of "cust4"
I am assigning "cust4" to channel "icket-cust4-ticketOjEIn" and similarly for each of the customers.
But, its showing all the documents to all the logged in customers.
My Sync gateway config is
{
"log": ["CRUD", "REST+", "Access"],
"CORS": {
"Origin":["*"],
"LoginOrigin":["*"],
"Headers":["Content-Type"],
"MaxAge": 1728000
},
"adminInterface":":4985",
"databases": {
"cwlite": {
"users": {
"GUEST": {"disabled": false, "admin_channels": ["*"]}
},
"sync": `
function (doc, oldDoc) {
if (doc.type == "ticket") {
channel("ticket-"+doc._id);
var ownerName = doc.owner.substring(doc.owner.indexOf(":") + 1);
log(doc.owner);
log(doc._id);
log(ownerName);
access(doc.owner, "ticket-"+doc._id);
}
}
`
}
}
}
User Document is (Created this user using admin interface)
-------------------------------------------------------------------------------
{
"name": "cust4",
"admin_channels": {
},
"all_channels": {
"!": 1,
"ticket-cust4-ticketOjEIn": 23
},
"sequence": 7,
"passwordhash_bcrypt": "JDJhJDEwJHZuVElOdWpGZC9lUENLSkZ5TzlONGVrdkRXdmw3bFUvNE4yNHhpbmZpaDRvcHFhNzlRQ2Vh",
"explicit_roles": {
"customer": 7
},
"rolesSince": {
"customer": 7
}
}
My expectation is to see user specific documents when replicated in mobile
Please help and let me know if any more information is required.
Thanks & Regards
Shiv