mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
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
This commit is contained in:
parent
badacdbb4a
commit
8d8a037e3f
23 changed files with 304 additions and 195 deletions
|
@ -11,7 +11,7 @@ import { objectConverter } from '../../helpers/core-utils'
|
|||
import { CONFIG, reloadConfig } from '../../initializers/config'
|
||||
import { ClientHtml } from '../../lib/client-html'
|
||||
import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares'
|
||||
import { customConfigUpdateValidator } from '../../middlewares/validators/config'
|
||||
import { customConfigUpdateValidator, ensureConfigIsEditable } from '../../middlewares/validators/config'
|
||||
|
||||
const configRouter = express.Router()
|
||||
|
||||
|
@ -38,6 +38,7 @@ configRouter.put('/custom',
|
|||
openapiOperationDoc({ operationId: 'putCustomConfig' }),
|
||||
authenticate,
|
||||
ensureUserHasRight(UserRight.MANAGE_CONFIGURATION),
|
||||
ensureConfigIsEditable,
|
||||
customConfigUpdateValidator,
|
||||
asyncMiddleware(updateCustomConfig)
|
||||
)
|
||||
|
@ -46,6 +47,7 @@ configRouter.delete('/custom',
|
|||
openapiOperationDoc({ operationId: 'delCustomConfig' }),
|
||||
authenticate,
|
||||
ensureUserHasRight(UserRight.MANAGE_CONFIGURATION),
|
||||
ensureConfigIsEditable,
|
||||
asyncMiddleware(deleteCustomConfig)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue