This commit is contained in:
George Saines 2014-03-14 15:24:39 -07:00
commit 93a7530b37

View file

@ -123,8 +123,8 @@ module.exports = class Handler
# Keeping it simple for now and just allowing access to the first FETCH_LIMIT results.
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) =>
selectString = 'slug name version commitMessage created permissions' # Is this even working?
@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)