codecombat/server/courses/course_instance_handler.coffee
2015-08-29 07:15:39 -07:00

13 lines
450 B
CoffeeScript

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()