Access Control Configuration
Pre-3.0 Legacy Configuration Equivalents
This content describes configuration for Sync Gateway 3.0 and higher — for legacy configuration, see: Legacy Pre-3.0 Configuration |
Upsert Sync Function
The sync function is crucial to the security of your application. It is in charge of data validation, access control and routing. The function executes every time a new revision/update is made to a document.
https:://{sgw-uri}/{db}/_config/sync https:://{sgw-uri}/{keyspace}/_config/sync
This will allow you to update the sync function.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
For more on the Sync Function and access control see: Sync Function Overview
Parameters
Path Parameters
Name | Description | Schema |
---|---|---|
keyspace |
The keyspace to run the operation against. A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection. |
String |
Body Parameter
Name | Description | Schema |
---|---|---|
Body |
The new sync function to use ifeval::["function (doc, oldDoc) { |
String |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
Updated sync function successfully |
|
400 |
There was a problem with your request |
|
404 |
Resource could not be found |
|
412 |
Precondition Failed The supplied If-Match header did not match the current version of the configuration. Returned when optimistic concurrency control is used, and there has been an update to the configuration in between this update. |