Parameters

operator string Internal login of the operator to escalate to, e.g. webapp.

Returns

context The previous login context — pass it back to logon() to restore.

Examples

A JSSP page or web app runs as the Anonymous operator by default, so any NLWS database call returns XTK-170019 Access denied. logonEscalation switches the session to a privileged operator (commonly webapp) so the rest of the page can read and write data.

It returns the previous context; restore it with logon(oldContext) once the privileged work is done.

var oldContext = logonEscalation("webapp"); // escalate to the webapp operator (grants DB access)
// ... privileged work, e.g. NLWS queries ...
logon(oldContext); // restore the previous (anonymous) context

Do not use logon(login) to escalate — it is deprecated and logs The 'logon' JavaScript method is deprecated. Use logonEscalation, or one of logonWithUser(login, password), logonWithToken(token), logonWithContext(context). logon() remains valid only to restore a context returned by logonEscalation.

See also

  • 📕 request - The HttpServletRequest object — read query parameters, body, headers and client info in a JSSP.
  • 📕 response - The HttpServletResponse object — set the content type, headers, cookies and redirects in a JSSP.