Hotfix for CLA submissions permissions

This commit is contained in:
Michael Schmatz 2014-04-24 08:45:42 -07:00
parent c408196814
commit b0865ce3d1

View file

@ -6,6 +6,7 @@ mongoose = require 'mongoose'
module.exports.setup = (app) ->
# This is hacky and should probably get moved somewhere else, I dunno
app.get '/db/cla.submissions', (req, res) ->
return errors.unauthorized(res, "You must be an admin to view that information") unless req.user?.isAdmin()
res.setHeader('Content-Type', 'application/json')
collection = mongoose.connection.db.collection 'cla.submissions', (err, collection) ->
return log.error "Couldn't fetch CLA submissions because #{err}" if err