Compare commits
2 Commits
temp/debug
...
temp/debug
Author | SHA1 | Date | |
---|---|---|---|
284d9b2efc | |||
f70e0cc838 |
@@ -14,6 +14,7 @@ module.exports = {
|
||||
getSetting,
|
||||
ignoreFiles,
|
||||
makeTOTP,
|
||||
SettingScope,
|
||||
};
|
||||
|
||||
const SettingScope = {
|
||||
@@ -31,10 +32,11 @@ const SettingScope = {
|
||||
* @param string key Setting key
|
||||
* @param object login Login object
|
||||
* @param object settings Settings object
|
||||
* @param string scope SettingScope value to specify where to search for the setting (optional)
|
||||
* @return object Setting value
|
||||
*/
|
||||
function getSetting(key, login, settings) {
|
||||
if (typeof login.settings[key] !== "undefined") {
|
||||
function getSetting(key, login, settings, scope = SettingScope.Login) {
|
||||
if (scope === SettingScope.Login && typeof login.settings[key] !== "undefined") {
|
||||
return login.settings[key];
|
||||
}
|
||||
if (typeof settings.stores[login.store.id].settings[key] !== "undefined") {
|
||||
|
Reference in New Issue
Block a user