codecombat/server/courses/course_instance_handler.coffee

14 lines
450 B
CoffeeScript
Raw Normal View History

2015-08-29 10:15:35 -04:00
mongoose = require 'mongoose'
Handler = require '../commons/Handler'
CourseInstance = require './CourseInstance'
CourseInstanceHandler = class CourseInstanceHandler extends Handler
modelClass: CourseInstance
jsonSchema: require '../../app/schemas/models/course_instance.schema'
allowedMethods: ['GET', 'POST', 'PUT', 'DELETE']
hasAccess: (req) ->
req.method is 'GET' or req.user?.isAdmin()
module.exports = new CourseInstanceHandler()