How to Ignore a document on mobile

Hi all,

Is there a way to ignore a document pushed from the sync gateway to the mobile? In the backend, I have one channel per company, but the documents should be stored in the mobile according to the user roles, so even though I have subscribed to the channel, I would like to filter which documents will actually get stored in the mobile according to some user data (which is not contained in the document itself). Can I implement some logic on the Replicator to ignore documents according to some given rules?

Did you checked the pull filter, but it only include the document and replicated document flags.

(Document, DocumentFlags) -> Bool

Is there a reason why you aren’t associating roles with channels and letting the Sync Gateway enforce access control as is the recommended pattern?

I can’t actually get the purpose of your not link roles and channels. Maybe I missed smth, of course