The children are an unordered array, so if you are looking for a specific name, you would have to loop through the array until you find what you are looking for.
8.0.2 introduces a new script function in perspective which may be of interest to you:
system.perspective.isAuthorized(boolean isAllOf, String[] securityLevels)
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
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.
Returns true
if the user in the current session is authorized, false
otherwise.
Example:
path1 = "Authenticated/Roles/Administrator"
path2 = "Foo/Bar/Baz"
isAuthorized = system.perspective.isAuthorized(False, [path1, path2])
We also introduce a new expression function along the same lines:
isAuthorized(boolean isAllOf, String... securityLevels)
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
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.
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.
Example:
isAuthorized(true, 'Authenticated/Roles/Administrator', 'Foo/Bar/Baz')