A newer version of this documentation is available.

View Latest

requireAdmin()

      +

      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
      requireAdmin(); (1)
      1 Throw an exception unless the request is sent to the Admin REST API