March 23, 2025
+ 12

Requiring Sync Gateway admin user

Related Topics:    access()   |   channel()   |   expiry()   |   requireAccess()   |   requireAdmin()   |   requireRole()   |   requireUser()   |   role()   |   throw()

Function

requireAdmin()

Purpose

Use the requireAdmin() function to reject document updates that are not made by the Sync Gateway Admin REST API.

Arguments

There are no arguments.

Use

Example 1. requireadmin
javascript
requireAdmin(); (1)
1 Throw an exception unless the request is sent to the Admin REST API