Query.isEnvProtected()

Test if the current database is protected.

Signature

Query.isEnvProtected(): Boolean

Description

The isEnvProtected() method tests if the current database is protected.

Parameters

None

Return value

Type Description

Boolean

Protected status:
true = The current database is protected.
false = The current database isn’t protected.

Examples

Call isEnvProtected() with built-in Admin role, on an unprotected database:

Query.isEnvProtected()
false

 

Calling isEnvProtected() with built-in Server role fails:

Query.isEnvProtected()
permission_denied

error: Insufficient privileges to perform the action.
at *query*:1:21
  |
1 | Query.isEnvProtected()
  |                     ^^
  |

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!