enigma-bbs/core/file_area.js
Bryan Ashby 5a0b291a02 * Some WIP on file area releated stuff - various partially implemented pieces coming together
* Some changes to database.js: Triggers for FTS were not being created properly
* Misc fixes & improvements
2016-09-28 21:54:25 -06:00

31 lines
No EOL
759 B
JavaScript

/* jslint node: true */
'use strict';
// ENiGMA½
const Config = require('./config.js').config;
const Log = require('./logger.js').log;
// deps
const _ = require('lodash');
exports.getAvailableFileAreas = getAvailableFileAreas;
exports.getFileAreaByTag = getFileAreaByTag;
function getAvailableFileAreas(client, options) {
options = options || { includeSystemInternal : false };
// perform ACS check per conf & omit system_internal if desired
return _.omit(Config.fileAreas.areas, (area, areaTag) => {
/* if(!options.includeSystemInternal && 'system_internal' === confTag) {
return true;
}*/
return !client.acs.hasFileAreaRead(area);
});
}
function getFileAreaByTag(areaTag) {
return Config.fileAreas.areas[areaTag];
}