|
|
@ -463,7 +463,13 @@ var userModule = function () {
|
|
|
|
publicMethods.isAuthorized = function (permission) {
|
|
|
|
publicMethods.isAuthorized = function (permission) {
|
|
|
|
var carbon = require("carbon");
|
|
|
|
var carbon = require("carbon");
|
|
|
|
var carbonServer = application.get("carbonServer");
|
|
|
|
var carbonServer = application.get("carbonServer");
|
|
|
|
var carbonUser = session.get(constants.USER_SESSION_KEY);
|
|
|
|
var carbonUser;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
carbonUser = session.get(constants.USER_SESSION_KEY);
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
|
|
|
|
carbonUser = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
var utility = require('/app/modules/utility.js').utility;
|
|
|
|
var utility = require('/app/modules/utility.js').utility;
|
|
|
|
if (!carbonUser) {
|
|
|
|
if (!carbonUser) {
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|