diff --git a/src/apps.js b/src/apps.js index 14456ba3b..1144b82b4 100644 --- a/src/apps.js +++ b/src/apps.js @@ -106,7 +106,6 @@ AppsError.PORT_RESERVED = 'Port Reserved'; AppsError.PORT_CONFLICT = 'Port Conflict'; AppsError.BILLING_REQUIRED = 'Billing Required'; AppsError.ACCESS_DENIED = 'Access denied'; -AppsError.USER_REQUIRED = 'User required'; AppsError.BAD_CERTIFICATE = 'Invalid certificate'; // Hostname validation comes from RFC 1123 (section 2.1) @@ -510,10 +509,6 @@ function install(data, auditSource, callback) { if (altDomain !== null && !validator.isFQDN(altDomain)) return callback(new AppsError(AppsError.BAD_FIELD, 'Invalid alt domain')); - // singleUser mode requires accessRestriction to contain exactly one user - if (manifest.singleUser && accessRestriction === null) return callback(new AppsError(AppsError.USER_REQUIRED)); - if (manifest.singleUser && accessRestriction.users.length !== 1) return callback(new AppsError(AppsError.USER_REQUIRED)); - var appId = uuid.v4(); if (icon) { diff --git a/src/routes/apps.js b/src/routes/apps.js index 94fdaff1f..8bc644d98 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -136,7 +136,6 @@ function installApp(req, res, next) { 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.BAD_CERTIFICATE) return next(new HttpError(400, error.message)); - if (error && error.reason === AppsError.USER_REQUIRED) return next(new HttpError(400, 'accessRestriction must specify one user')); if (error && error.reason === AppsError.EXTERNAL_ERROR) return next(new HttpError(503, error.message)); if (error) return next(new HttpError(500, error)); diff --git a/src/routes/test/apps-test.js b/src/routes/test/apps-test.js index d309f3a84..8f1642178 100644 --- a/src/routes/test/apps-test.js +++ b/src/routes/test/apps-test.js @@ -56,7 +56,6 @@ APP_MANIFEST.dockerImage = TEST_IMAGE; var APP_MANIFEST_1 = JSON.parse(fs.readFileSync(__dirname + '/../../../../test-app/CloudronManifest.json', 'utf8')); APP_MANIFEST_1.dockerImage = TEST_IMAGE; -APP_MANIFEST_1.singleUser = true; var USERNAME = 'superadmin', PASSWORD = 'Foobar?1337', EMAIL ='admin@me.com'; var USER_1_ID = null, USERNAME_1 = 'user', EMAIL_1 ='user@me.com'; @@ -394,28 +393,6 @@ describe('Apps', function () { }); }); - it('app install fails - accessRestriction no users not allowed', function (done) { - superagent.post(SERVER_URL + '/api/v1/apps/install') - .query({ access_token: token }) - .send({ manifest: APP_MANIFEST_1, password: PASSWORD, location: APP_LOCATION, portBindings: {}, accessRestriction: null }) - .end(function (err, res) { - expect(res.statusCode).to.equal(400); - expect(res.body.message).to.eql('accessRestriction must specify one user'); - done(); - }); - }); - - it('app install fails - accessRestriction too many users not allowed', function (done) { - superagent.post(SERVER_URL + '/api/v1/apps/install') - .query({ access_token: token }) - .send({ manifest: APP_MANIFEST_1, password: PASSWORD, location: APP_LOCATION, portBindings: {}, accessRestriction: { users: [ 'one', 'two' ] } }) - .end(function (err, res) { - expect(res.statusCode).to.equal(400); - expect(res.body.message).to.eql('accessRestriction must specify one user'); - done(); - }); - }); - it('app install fails for non admin', function (done) { superagent.post(SERVER_URL + '/api/v1/apps/install') .query({ access_token: token_1 })