lock the admin domain based on the edition

This commit is contained in:
Girish Ramakrishnan
2018-09-05 22:58:43 -07:00
parent 91a1bc7a01
commit 8d5e70f6aa
4 changed files with 32 additions and 7 deletions
+11 -1
View File
@@ -5,7 +5,9 @@ exports = module.exports = {
get: get,
getAll: getAll,
update: update,
del: del
del: del,
verifyDomainLock: verifyDomainLock
};
var assert = require('assert'),
@@ -14,6 +16,14 @@ var assert = require('assert'),
HttpError = require('connect-lastmile').HttpError,
HttpSuccess = require('connect-lastmile').HttpSuccess;
function verifyDomainLock(req, res, next) {
assert.strictEqual(typeof req.params.domain, 'string');
if (domains.isLocked(req.params.domain)) return next(new HttpError(423, 'This domain is locked'));
next();
}
function add(req, res, next) {
assert.strictEqual(typeof req.body, 'object');