Add option to allow non-admins to access SFTP
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user