mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-04 21:01:06 -05:00
27 lines
No EOL
611 B
CoffeeScript
27 lines
No EOL
611 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'
|
|
'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() |