Enforce app count limit during installation
This commit is contained in:
@@ -149,6 +149,7 @@ exports = module.exports = {
|
||||
};
|
||||
|
||||
const appTaskManager = require('./apptaskmanager.js'),
|
||||
appstore = require('./appstore.js'),
|
||||
archives = require('./archives.js'),
|
||||
assert = require('node:assert'),
|
||||
backups = require('./backups.js'),
|
||||
@@ -1375,6 +1376,10 @@ async function install(data, auditSource) {
|
||||
|
||||
assert.strictEqual(typeof data.manifest, 'object'); // manifest is already downloaded
|
||||
|
||||
const features = appstore.getFeatures();
|
||||
const installedAppCount = await getCount();
|
||||
if (features.appMaxCount <= installedAppCount) throw new BoxError(BoxError.PLAN_LIMIT);
|
||||
|
||||
const subdomain = data.subdomain.toLowerCase(),
|
||||
domain = data.domain.toLowerCase(),
|
||||
accessRestriction = data.accessRestriction || null,
|
||||
|
||||
Reference in New Issue
Block a user