mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-14 17:51:55 -05:00
14 lines
378 B
CoffeeScript
14 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()
|