Fix admin edition disabling feature

This commit is contained in:
Chocobozzz
2021-10-14 11:35:43 +02:00
parent e1a570abff
commit cf0c8ee588
14 changed files with 61 additions and 20 deletions

View File

@@ -106,12 +106,13 @@ const customConfigUpdateValidator = [
]
function ensureConfigIsEditable (req: express.Request, res: express.Response, next: express.NextFunction) {
if (!CONFIG.WEBADMIN.CONFIGURATION.EDITS.ALLOWED) {
if (!CONFIG.WEBADMIN.CONFIGURATION.EDITION.ALLOWED) {
return res.fail({
status: HttpStatusCode.METHOD_NOT_ALLOWED_405,
message: 'Server configuration is static and cannot be edited'
})
}
return next()
}