aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/models/Access.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/Access.js')
-rw-r--r--models/Access.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/models/Access.js b/models/Access.js
index 9302339..ab45b4c 100644
--- a/models/Access.js
+++ b/models/Access.js
@@ -48,7 +48,22 @@ AccessSchema.statics = {
},
- /**
+ /**
+ * Load all users associated with a project
+ *
+ * @param {ObjectId} project
+ * @param {Function} callback
+ * @api private
+ */
+
+ loadProject: function(project, callback) {
+ this.find({ project: project })
+ .populate('user')
+ .sort({ 'created': 1 }) // sort by date
+ .exec(callback);
+ },
+
+ /**
* Check to see if user has access to a particular project
*
* @param {ObjectId} user