diff options
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/config.ts | 4 |
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' | |||
11 | import { CONFIG, reloadConfig } from '../../initializers/config' | 11 | import { CONFIG, reloadConfig } from '../../initializers/config' |
12 | import { ClientHtml } from '../../lib/client-html' | 12 | import { ClientHtml } from '../../lib/client-html' |
13 | import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares' | 13 | import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares' |
14 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' | 14 | import { customConfigUpdateValidator, ensureConfigIsEditable } from '../../middlewares/validators/config' |
15 | 15 | ||
16 | const configRouter = express.Router() | 16 | const 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 | ||