Using admin REST API on sync gateway

@agillette

Using the ADMIN API is probably the better solution. In this case any require methods you call in your sync function will return true, i.e.

requireUser
requireRole
requireAccess

Making sure this is valid for the docs your are writing as ADMIN is up to you.

If you were to use a super user account to access Sync Gateway from your server code, the require functions would probably not be usable as they are usually passed parameters taken from the document content, e.g. you might call requireUser(doc.owner) to ensure that only an authenticated user can write documents with their id in the owner property.

This would fail as you would be writing the doc having authenticated as the super user.

Andy