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