mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-01 15:50:11 -04:00
Added 'github' permission type to allow access to CLAs view.
This commit is contained in:
parent
39cee01ba8
commit
753acb1299
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ hipchat = require '../hipchat'
|
|||
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()
|
||||
return errors.unauthorized(res, 'You must be an admin to view that information') unless req.user?.isAdmin() or ('github' in req.user?.permissions ? [])
|
||||
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
|
||||
|
@ -26,7 +26,7 @@ module.exports.setup = (app) ->
|
|||
parts = module.split('/')
|
||||
module = parts[0]
|
||||
return getSchema(req, res, module) if parts[1] is 'schema'
|
||||
if (not req.user) and req.route.method isnt 'get'
|
||||
if (not req.user) and req.route.method isnt 'get'
|
||||
return errors.unauthorized(res, 'Must have an identity to do anything with the db. Do you have cookies enabled?')
|
||||
|
||||
try
|
||||
|
|
Loading…
Add table
Reference in a new issue