mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 02:55:43 -05:00
13 lines
378 B
CoffeeScript
13 lines
378 B
CoffeeScript
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()
|