codecombat/server/levels/components/level_component_handler.coffee

25 lines
630 B
CoffeeScript

LevelComponent = require './LevelComponent'
Handler = require '../../commons/Handler'
LevelComponentHandler = class LevelComponentHandler extends Handler
modelClass: LevelComponent
jsonSchema: require '../../../app/schemas/models/level_component'
editableProperties: [
'system'
'description'
'code'
'js'
'codeLanguage'
'dependencies'
'propertyDocumentation'
'configSchema'
'name'
'i18nCoverage'
]
getEditableProperties: (req, document) ->
props = super(req, document)
props.push('official') if req.user?.isAdmin()
props
module.exports = new LevelComponentHandler()