do not allow removing the admin group

This commit is contained in:
Johannes Zellner
2016-02-13 12:24:51 +01:00
parent 63cab7d751
commit 754e33af2a
3 changed files with 24 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ function remove(req, res, next) {
groups.remove(req.params.groupId, function (error) {
if (error && error.reason === GroupError.NOT_FOUND) return next(new HttpError(404, 'Group not found'));
if (error && error.reason === GroupError.NOT_EMPTY) return next(new HttpError(409, 'Group not empty'));
if (error && error.reason === GroupError.NOT_ALLOWED) return next(new HttpError(409, 'Group deletion not allowed'));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(204));