Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scripting_function

system.perspective.isAuthorized

Panel
titleDescription

Checks if the user in the current Session is authorized against a target collection of security levels.

Panel
titleSyntax

system.perspective.isAuthorized(isAllOf, securityLevels, [sessionID])

  • 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.

List[String] securityLevels - An array of string paths to a security level node in the form of "Path/To/Node". Each level in the tree is delimited by a forward slash character. The public node is never a part of the path.


New_in
Version8.1.3


String sessionId - New in 8.1.3. Identifier of the Session to target. If omitted, the current Session will be used automatically. [optional]

  • Returns

True if the user logged into the specified session is authorized, false otherwise.

  • Scope

Gateway, Perspective Session

Panel
titleCode Examples
Code Block
languagepy
titleCode Snippet
# Returns true if the current user has either Administrator or Baz.
# Returns false if they have neither.
path1 = "Authenticated/Roles/Administrator"
path2 = "Foo/Bar/Baz"
isAuthorized = system.perspective.isAuthorized(False, [path1, path2])
Panel
titleKeywords

system perspective isAuthorized, perspective.isAuthorized