codecombat/server/levels/components/level_component_handler.coffee
Sébastien Moratinos e7ca7c4c1a remove unused modules
2014-01-23 01:01:45 +01:00

27 lines
No EOL
635 B
CoffeeScript

LevelComponent = require('./LevelComponent')
Handler = require('../../commons/Handler')
LevelComponentHandler = class LevelComponentHandler extends Handler
modelClass: LevelComponent
editableProperties: [
'system'
'description'
'code'
'js'
'language'
'dependencies'
'propertyDocumentation'
'configSchema'
]
postEditableProperties: ['name']
getEditableProperties: (req, document) ->
props = super(req, document)
props.push('official') if req.user?.isAdmin()
props
hasAccess: (req) ->
req.method is 'GET' or req.user?.isAdmin()
module.exports = new LevelComponentHandler()