Security Functions

Overview

These functions check user permissions as part of the rule notification logic and allow or deny response actions such as sending portals or invoking scripts.

Reference

Processing

The boolean functions below return true if the user is valid and allowed to execute the given action. Otherwise, the function returns false.

As an alternative to if/else syntax, set the optional err parameter to true, which causes the function to stop processing altogether in case of insufficient permissions.

userInGroup

userInGroup(string u, string g [, boolean err]) boolean

Returns true if the user u exists, is enabled, and belongs to the specified user group g.

userHasRole

userHasRole(string u, string r [, boolean err]) boolean

Returns true if the user u exists, is enabled, and has the specified role r.

userAllowEntity

userAllowEntity(string u, string e [, boolean err]) boolean

Returns true if the user u exists, is enabled, has READ permission for the specified entity e.

userAllowEntityGroup

userAllowEntityGroup(string u, string g [, boolean err]) boolean

Returns true if the user u exists, is enabled, and has READ permission to the specified entity group g.

userAllowPortal

userAllowPortal(string u, string p [, boolean err]) boolean

Returns true if the user u exists, is enabled, and has permissions to view the specified portal p.