aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/config.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index d542f62aa..5ea1f67c9 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -11,7 +11,7 @@ import { objectConverter } from '../../helpers/core-utils'
11import { CONFIG, reloadConfig } from '../../initializers/config' 11import { CONFIG, reloadConfig } from '../../initializers/config'
12import { ClientHtml } from '../../lib/client-html' 12import { ClientHtml } from '../../lib/client-html'
13import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares' 13import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares'
14import { customConfigUpdateValidator } from '../../middlewares/validators/config' 14import { customConfigUpdateValidator, ensureConfigIsEditable } from '../../middlewares/validators/config'
15 15
16const configRouter = express.Router() 16const configRouter = express.Router()
17 17
@@ -38,6 +38,7 @@ configRouter.put('/custom',
38 openapiOperationDoc({ operationId: 'putCustomConfig' }), 38 openapiOperationDoc({ operationId: 'putCustomConfig' }),
39 authenticate, 39 authenticate,
40 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION), 40 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION),
41 ensureConfigIsEditable,
41 customConfigUpdateValidator, 42 customConfigUpdateValidator,
42 asyncMiddleware(updateCustomConfig) 43 asyncMiddleware(updateCustomConfig)
43) 44)
@@ -46,6 +47,7 @@ configRouter.delete('/custom',
46 openapiOperationDoc({ operationId: 'delCustomConfig' }), 47 openapiOperationDoc({ operationId: 'delCustomConfig' }),
47 authenticate, 48 authenticate,
48 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION), 49 ensureUserHasRight(UserRight.MANAGE_CONFIGURATION),
50 ensureConfigIsEditable,
49 asyncMiddleware(deleteCustomConfig) 51 asyncMiddleware(deleteCustomConfig)
50) 52)
51 53