GlideImpersonate

 example


(function() { var oUser = GlideUser.getUser('abel.tuter'), oImpersonate = new GlideImpersonate(); if (oUser) { // Start impersonation var sImpersonator = oImpersonate.impersonate(oUser.getID()); gs.info('Started impersonating: ' + gs.getUser().getDisplayName()); // Script comes here-- e.g. testing UI action conditions. Good for testing ACLs gs.print("User has roles: " + gs.getUser().hasRoles()); // End impersonation oImpersonate.impersonate(sImpersonator); } else { gs.warn("Trying to impersonate non-existent user"); } })();

Comments

Popular posts from this blog

GlideRecord setValue

variable advanced reference qualifier example

URL link in addInfoMessage