aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/models
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-13 10:53:00 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-13 10:53:00 +0200
commit1b8bada3b73bcf78cf8c1385d44bca5036a78617 (patch)
treeb017dd05603996520192a25d783c745ecefbe281 /models
parent added ppost feature (diff)
downloadDivid-1b8bada3b73bcf78cf8c1385d44bca5036a78617.tar.gz
edited the checkAccess function
Diffstat (limited to 'models')
-rw-r--r--models/Access.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/models/Access.js b/models/Access.js
index ee62911..3c29a36 100644
--- a/models/Access.js
+++ b/models/Access.js
@@ -40,16 +40,15 @@ AccessSchema.statics = {
*
* @param {ObjectId} user
* @param {ObjectId} project
- * @return {Boolean}
- * @api public
+ * @param {Function} callback
+ * @api private
*/
- checkAccess: function(user, project) {
+ checkAccess: function(user, project, callback) {
console.log('inni checkAccess!')
- this.findOne({ user: user }).where('project').equals(project).exec(function(err, access) {
- if (err || !access) return false;
- else return true;
- });
+ this.findOne({ user: user })
+ .where('project').equals(project)
+ .exec(callback);
}
}