Admin Portal provides JavaScript modules that you can use in your policy script. These modules provide libraries of functions related to different kinds of data. To use any of the functions that are in a module, be sure to invoke the module first.

For example, the starter script invokes the user module:

      trace("not onprem");
		var umod = module('User');
		var user = umod.GetCurrentUser();
          trace("allow sysadmin");
		policy.RequiredLevel = 2;
      } else {
       trace("block non sysadim");
          policy.Locked = true;