diff options
Diffstat (limited to 'models/Access.js')
-rw-r--r-- | models/Access.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/models/Access.js b/models/Access.js index ab45b4c..75f6003 100644 --- a/models/Access.js +++ b/models/Access.js @@ -63,6 +63,23 @@ AccessSchema.statics = { .exec(callback); }, + + /** + * Load all users associated with several projects + * + * @param {Arrau[ObjectId]} projects + * @param {Function} callback + * @api private + */ + + loadProjects: function(projects, callback) { + this.find({ project: { $in: projects } }) + .populate({ path: 'user', select: 'name email status' }) + .sort({ 'created': -1 }) + .exec(callback); + }, + + /** * Check to see if user has access to a particular project * |