Question about sync gateway access function

I have a need where potentially I need to give large number of users access to a document, like say 100,000 users. What’s the best way to do this?

Create a role, give that role access to the doc, and give all of those users that role (via the admin API).

Thanks @jens.

What’s the limitations on the number of roles that Couchbase supports? I want to create a role that correlates to a document and say there are 100k docs.


There isn’t a fixed limit on the number of roles supported by Sync Gateway, but there will be performance implications for a ‘one channel per document’ or ‘one role per document’ security model.

How many roles do you expect each user to be granted?

@adamf, I can PM you about my specific situation?

@agillette OK - I’ll watch for that.