codecombat/server/courses/course_handler.coffee

14 lines
378 B
CoffeeScript
Raw Normal View History

2015-08-29 10:15:35 -04:00
mongoose = require 'mongoose'
Handler = require '../commons/Handler'
Course = require './Course'
CourseHandler = class CourseHandler extends Handler
modelClass: Course
jsonSchema: require '../../app/schemas/models/course.schema'
allowedMethods: ['GET']
hasAccess: (req) ->
req.method in @allowedMethods or req.user?.isAdmin()
module.exports = new CourseHandler()