|
|
|
@ -39,8 +39,8 @@ utility = function () {
|
|
|
|
|
PrivilegedCarbonContext.startTenantFlow();
|
|
|
|
|
context = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
|
|
|
|
context.setTenantDomain(carbon.server.tenantDomain({
|
|
|
|
|
tenantId: userInfo.tenantId
|
|
|
|
|
}));
|
|
|
|
|
tenantId: userInfo.tenantId
|
|
|
|
|
}));
|
|
|
|
|
context.setTenantId(userInfo.tenantId);
|
|
|
|
|
context.setUsername(userInfo.username || null);
|
|
|
|
|
};
|
|
|
|
@ -161,15 +161,19 @@ utility = function () {
|
|
|
|
|
* @returns {*}
|
|
|
|
|
*/
|
|
|
|
|
publicMethods.encodeJson = function (text) {
|
|
|
|
|
return text
|
|
|
|
|
.replace(/\\u003c/g, "<")
|
|
|
|
|
.replace(/</g, "<")
|
|
|
|
|
.replace(/\\u003e/g, ">")
|
|
|
|
|
.replace(/>/g, ">")
|
|
|
|
|
.replace(/\\u0027/g, "'")
|
|
|
|
|
.replace(/'/g, "'")
|
|
|
|
|
.replace(/\\"/g, """)
|
|
|
|
|
.replace(/\\u0022/g, """)
|
|
|
|
|
if (text) {
|
|
|
|
|
return text
|
|
|
|
|
.replace(/\\u003c/g, "<")
|
|
|
|
|
.replace(/</g, "<")
|
|
|
|
|
.replace(/\\u003e/g, ">")
|
|
|
|
|
.replace(/>/g, ">")
|
|
|
|
|
.replace(/\\u0027/g, "'")
|
|
|
|
|
.replace(/'/g, "'")
|
|
|
|
|
.replace(/\\"/g, """)
|
|
|
|
|
.replace(/\\u0022/g, """);
|
|
|
|
|
} else {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return publicMethods;
|
|
|
|
|