mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-03 04:17:12 -05:00
13 lines
450 B
CoffeeScript
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()
|