SecurityLevelConfig for the "public" tree?

If i edit a tag's security properties, I am greeted with this little "tree" structure of the "Authenticated" security level.

Is there a way to get this same tree, or even just a flattened list of all security levels, from scripting? I found this which has a method toJson() that should give me the structure I'm looking for, however I can't figure out how to get the SecurityLevelConfig for the "public" level that would include all the possible children?

Figured it out myself, gotta use com.inductiveautomation.ignition.gateway.IgnitionGateway.get().getSecurityLevelManager().getSecurityLevelsConfig().toArray()