|
|
@@ -121,6 +121,14 @@ module.exports = (crowi) => {
|
|
|
});
|
|
|
// TODO writte swagger
|
|
|
router.put('/:id/activate', loginRequiredStrictly, adminRequired, csrf, async(req, res) => {
|
|
|
+ // check user upper limit
|
|
|
+ const isUserCountExceedsUpperLimit = await User.isUserCountExceedsUpperLimit();
|
|
|
+ if (isUserCountExceedsUpperLimit) {
|
|
|
+ const msg = 'Unable to activate because user has reached limit';
|
|
|
+ logger.error('Error', msg);
|
|
|
+ return res.apiv3Err(new ErrorV3(msg));
|
|
|
+ }
|
|
|
+
|
|
|
const { id } = req.params;
|
|
|
|
|
|
try {
|