Require exactly one user in accessRestriction for singleUser app installations

This commit is contained in:
Johannes Zellner
2015-10-16 20:01:45 +02:00
parent 0ca09c384a
commit fa193276c9
3 changed files with 34 additions and 0 deletions

View File

@@ -129,6 +129,7 @@ function installApp(req, res, next) {
if (error && error.reason === AppsError.PORT_CONFLICT) return next(new HttpError(409, 'Port ' + error.message + ' is already in use.'));
if (error && error.reason === AppsError.BAD_FIELD) return next(new HttpError(400, error.message));
if (error && error.reason === AppsError.BILLING_REQUIRED) return next(new HttpError(402, 'Billing required'));
if (error && error.reason === AppsError.USER_REQUIRED) return next(new HttpError(400, 'accessRestriction must specify one user'));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(202, { id: appId } ));