mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 14:33:59 -04:00
Fix getting a document by slug or id and projecting it without its permissions
This commit is contained in:
parent
cac9a7463f
commit
9f3b177574
1 changed files with 1 additions and 0 deletions
|
@ -214,6 +214,7 @@ module.exports = class Handler
|
|||
if req.query.project
|
||||
projection = {}
|
||||
projection[field] = 1 for field in req.query.project.split(',')
|
||||
projection.permissions = 1 # TODO: A better solution for always including properties the server needs
|
||||
@getDocumentForIdOrSlug id, projection, (err, document) =>
|
||||
return @sendDatabaseError(res, err) if err
|
||||
return @sendNotFoundError(res) unless document?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue