rename directory config to profile config
This commit is contained in:
@@ -5,7 +5,7 @@ exports = module.exports = {
|
||||
get,
|
||||
|
||||
// owner only settings
|
||||
setBackupConfig
|
||||
setBackupConfig,
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
@@ -235,20 +235,20 @@ async function setRegistryConfig(req, res, next) {
|
||||
next(new HttpSuccess(200));
|
||||
}
|
||||
|
||||
async function getDirectoryConfig(req, res, next) {
|
||||
const [error, directoryConfig] = await safe(settings.getDirectoryConfig());
|
||||
async function getProfileConfig(req, res, next) {
|
||||
const [error, directoryConfig] = await safe(settings.getProfileConfig());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, directoryConfig));
|
||||
}
|
||||
|
||||
async function setDirectoryConfig(req, res, next) {
|
||||
async function setProfileConfig(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
|
||||
if (typeof req.body.lockUserProfiles !== 'boolean') return next(new HttpError(400, 'lockUserProfiles is required'));
|
||||
if (typeof req.body.mandatory2FA !== 'boolean') return next(new HttpError(400, 'mandatory2FA is required'));
|
||||
|
||||
const [error] = await safe(settings.setDirectoryConfig(req.body));
|
||||
const [error] = await safe(settings.setProfileConfig(req.body));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, {}));
|
||||
@@ -307,7 +307,7 @@ function get(req, res, next) {
|
||||
case settings.AUTOUPDATE_PATTERN_KEY: return getAutoupdatePattern(req, res, next);
|
||||
case settings.TIME_ZONE_KEY: return getTimeZone(req, res, next);
|
||||
|
||||
case settings.DIRECTORY_CONFIG_KEY: return getDirectoryConfig(req, res, next);
|
||||
case settings.PROFILE_CONFIG_KEY: return getProfileConfig(req, res, next);
|
||||
case settings.SUPPORT_CONFIG_KEY: return getSupportConfig(req, res, next);
|
||||
|
||||
default: return next(new HttpError(404, 'No such setting'));
|
||||
@@ -330,7 +330,7 @@ function set(req, res, next) {
|
||||
case settings.AUTOUPDATE_PATTERN_KEY: return setAutoupdatePattern(req, res, next);
|
||||
case settings.TIME_ZONE_KEY: return setTimeZone(req, res, next);
|
||||
|
||||
case settings.DIRECTORY_CONFIG_KEY: return setDirectoryConfig(req, res, next);
|
||||
case settings.PROFILE_CONFIG_KEY: return setProfileConfig(req, res, next);
|
||||
|
||||
default: return next(new HttpError(404, 'No such setting'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user