Skip to content

Commit

Permalink
fix #61
Browse files Browse the repository at this point in the history
  • Loading branch information
alocher committed Jan 30, 2016
1 parent 3140ed9 commit d04b925
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/repositoryCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ var update = function(entry, module, res) {
};

exports.getAll = function(req, res) {
Module.find({ moduleType: 'public' }, { moduleDefinition: 0, email: 0, created_by: 0, sessions: 0, moduleProperties: 0, invites: 0 }, function(err, entries) {
Module.find({ $or: [ { moduleType: 'public' }, {$and: [{ moduleType: 'private' }, {"invites.users": { $elemMatch: { email: req.user.email } } }] } ] }
, { moduleDefinition: 0, email: 0, created_by: 0, sessions: 0, moduleProperties: 0, invites: 0 }, function(err, entries) {
if (err) {
res.status(500).send(err);
} else {
Expand Down

0 comments on commit d04b925

Please sign in to comment.