Storage Permissions now at server.config file
This commit is contained in:
1 parent
fb77bbefa0
commit
ff69195d2e
2 files changed
+4
-22
No files matched your search
@@ -9,29 +9,11 @@
|
||||
|
||||
return thisObject;
|
||||
|
||||
function initialize(callBackFunction) {
|
||||
function initialize(pServerConfig, callBackFunction) {
|
||||
|
||||
readStoragePermissions();
|
||||
permissions = pServerConfig.storagePermissions;
|
||||
|
||||
function readStoragePermissions() {
|
||||
|
||||
let filePath;
|
||||
|
||||
try {
|
||||
let fs = require('fs');
|
||||
filePath = './' + 'Storage' + '/' + 'Storage.Permissions.json';
|
||||
permissions = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
||||
|
||||
callBackFunction();
|
||||
|
||||
}
|
||||
catch (err) {
|
||||
console.log("[ERROR] readStoragePermissions -> err = " + err.message);
|
||||
console.log("[HINT] readStoragePermissions -> You need to have a file at this path -> " + filePath);
|
||||
|
||||
callBackFunction();
|
||||
}
|
||||
}
|
||||
callBackFunction();
|
||||
}
|
||||
|
||||
function getPermission(pContainer, pType, pDays) {
|
||||
|
||||
@@ -135,7 +135,7 @@ function initialize() {
|
||||
const STORAGE_ACCESS_MANAGER = require('./Server/StorageAccessManager');
|
||||
storageAccessManager = STORAGE_ACCESS_MANAGER.newStorageAccessManager();
|
||||
|
||||
storageAccessManager.initialize(onInitialized);
|
||||
storageAccessManager.initialize(serverConfig, onInitialized);
|
||||
|
||||
function onInitialized() {
|
||||
|
||||
|
||||
Reference in new issue
Block a user