mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 16:17:57 -05:00
20 lines
524 B
CoffeeScript
20 lines
524 B
CoffeeScript
AnalyticsLogEvent = require './AnalyticsLogEvent'
|
|
Handler = require '../commons/Handler'
|
|
|
|
class AnalyticsLogEventHandler extends Handler
|
|
modelClass: AnalyticsLogEvent
|
|
jsonSchema: require '../../app/schemas/models/analytics_log_event'
|
|
editableProperties: [
|
|
'event'
|
|
'properties'
|
|
]
|
|
|
|
hasAccess: (req) ->
|
|
req.method in ['POST'] or req.user?.isAdmin()
|
|
|
|
makeNewInstance: (req) ->
|
|
instance = super(req)
|
|
instance.set('user', req.user._id)
|
|
instance
|
|
|
|
module.exports = new AnalyticsLogEventHandler()
|