is_admin_user

is_admin_user says weather the currently logged in user is an admin user. Generally used for extra security checks just prior to performing critical admin-only operations.

Runs on: the server only. The statement that calls it runs on the server, and its result is a server-side value: the server keeps it, the device never writes it, and it is copied to the device only when a device statement reads it.

Format:

is_admin_user()

Parameters:

This function does not take any parameters.

Returned Value:

Type Description
boolean TRUE if the user is logged in as the administrator, FALSE otherwise

Examples

 if (is_admin_user()) {
     application.status = "approved"
 } 
 else {
     alert("You have to be the administrator to approve an application!")
 }