This commit is contained in:
Michael Schmatz 2014-03-14 14:27:43 -07:00
parent 07a0057e72
commit 7d150d96e8

View file

@ -124,7 +124,7 @@ module.exports = class Handler
query = {'original': mongoose.Types.ObjectId(id)}
sort = {'created': -1}
selectString = 'slug name version commitMessage created' # Is this even working?
@modelClass.find(query).select(selectString).lean().limit(FETCH_LIMIT).sort(sort).exec (err, results) =>
@modelClass.find(query).select(selectString).limit(FETCH_LIMIT).sort(sort).exec (err, results) =>
return @sendDatabaseError(res, err) if err
for doc in results
return @sendUnauthorizedError(res) unless @hasAccessToDocument(req, doc)