aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorJelle Besseling <jelle@pingiun.com>2021-10-12 13:33:44 +0200
committerGitHub <noreply@github.com>2021-10-12 13:33:44 +0200
commit8d8a037e3fe9b1d2ccbc4169ce59b13000b59cb0 (patch)
tree755ba56bc3acbd82ec195974545581c1e49aae5e /server/controllers/api
parentbadacdbb4a3e4a1aae4d324abc496be8e261b2ef (diff)
downloadPeerTube-8d8a037e3fe9b1d2ccbc4169ce59b13000b59cb0.tar.gz
PeerTube-8d8a037e3fe9b1d2ccbc4169ce59b13000b59cb0.tar.zst
PeerTube-8d8a037e3fe9b1d2ccbc4169ce59b13000b59cb0.zip
Allow configuration to be static/readonly (#4315)
* Allow configuration to be static/readonly * Make all components disableable * Improve disabled component styling * Rename edits allowed field in configuration * Fix CI
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