From e7e4b0154ed5aaa41aef8288eb2d4ae2599cb2dc Mon Sep 17 00:00:00 2001 From: "Eslam A. Hefnawy" Date: Tue, 10 Jul 2018 16:29:33 +0300 Subject: [PATCH] add getLocalAccessKey method --- lib/classes/Utils.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/classes/Utils.js b/lib/classes/Utils.js index c0b7bb454..7bdc8e62c 100644 --- a/lib/classes/Utils.js +++ b/lib/classes/Utils.js @@ -329,6 +329,18 @@ class Utils { } }); } + + getLocalAccessKey() { + const userConfig = configUtils.getConfig(); + const currentId = userConfig.userId; + const globalConfig = configUtils.getGlobalConfig(); + if (globalConfig.users && globalConfig.users[currentId] && + globalConfig.users[currentId].dashboard && + globalConfig.users[currentId].dashboard.accessKey) { + return globalConfig.users[currentId].dashboard.accessKey; + } + return false; + } } module.exports = Utils;