isAuthorized
This function is used by Ignition's Expression language.
Description​
Returns a qualified value with a boolean value which is true if the user in the current Session is authorized, false otherwise. Scope is Perspective Sessions only.
Syntax​
isAuthorized(isAllOf, securityLevel[, securityLevelN...])
Parameters
Boolean isAllOf - True if the current user must have all of the given security levels to be authorized, false if the current user must have at least one of the given security levels to be authorized
String securityLevels - One or more String paths to a security level node in the form "Path/To/Node". Each level in the tree is delimited by a forward slash character. Additional security level paths are simply added to the end of the parameter list. The Public node is never a part of the path.
Results
- Boolean - Returns a qualified value with a boolean value which is true if the user in the current Session is authorized, false otherwise. The quality of the qualified value is the worst of the qualities of all the qualified values of each argument.
Examples​
// Returns true if the current user has both Administrator and Baz roles.
// Returns false if they have only one or if they have neither.
isAuthorized(true, 'Authenticated/Roles/Administrator', 'Foo/Bar/Baz')