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