Add option to allow non-admins to access SFTP

This commit is contained in:
Girish Ramakrishnan
2020-10-21 22:31:59 -07:00
parent cc618abf58
commit 4881d8e3a1
4 changed files with 28 additions and 9 deletions

View File

@@ -46,6 +46,11 @@ function configure(req, res, next) {
memorySwap: req.body.memorySwap
};
if (req.params.service === 'sftp' && 'requireAdmin' in req.body) {
if (typeof req.body.requireAdmin !== 'boolean') return next(new HttpError(400, 'requireAdmin must be a boolean'));
data.requireAdmin = req.body.requireAdmin;
}
addons.configureService(req.params.service, data, function (error) {
if (error) return next(BoxError.toHttpError(error));