2014-01-22 17:57:41 -05:00
|
|
|
LevelSystem = require('./LevelSystem')
|
|
|
|
Handler = require('../../commons/Handler')
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
LevelSystemHandler = class LevelSystemHandler extends Handler
|
|
|
|
modelClass: LevelSystem
|
|
|
|
editableProperties: [
|
|
|
|
'description'
|
|
|
|
'code'
|
|
|
|
'js'
|
|
|
|
'language'
|
|
|
|
'dependencies'
|
|
|
|
'propertyDocumentation'
|
|
|
|
'configSchema'
|
|
|
|
]
|
|
|
|
postEditableProperties: ['name']
|
2014-04-08 17:10:50 -04:00
|
|
|
jsonSchema: require './level_system_schema'
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
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()
|