mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
27 lines
651 B
CoffeeScript
27 lines
651 B
CoffeeScript
LevelSystem = require('./LevelSystem')
|
|
Handler = require('../../commons/Handler')
|
|
|
|
LevelSystemHandler = class LevelSystemHandler extends Handler
|
|
modelClass: LevelSystem
|
|
editableProperties: [
|
|
'description'
|
|
'code'
|
|
'js'
|
|
'language'
|
|
'dependencies'
|
|
'propertyDocumentation'
|
|
'configSchema'
|
|
]
|
|
postEditableProperties: ['name']
|
|
jsonSchema: require './level_system_schema'
|
|
|
|
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 LevelSystemHandler()
|