This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
codecombat/server/levels/components/level_component_handler.coffee
2014-07-09 12:21:32 -07:00

24 lines
611 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'
]
getEditableProperties: (req, document) ->
props = super(req, document)
props.push('official') if req.user?.isAdmin()
props
module.exports = new LevelComponentHandler()