aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/models
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-04-30 09:58:35 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-04-30 09:58:35 +0200
commitd9adc8029baee3eebec8ec809e13ae867132b8f0 (patch)
tree96e9ce60d68598782a8db786ffac766e9f04a29f /models
parentworking with project listing (diff)
downloadDivid-d9adc8029baee3eebec8ec809e13ae867132b8f0.tar.gz
Added accessscema for project access
Diffstat (limited to 'models')
-rw-r--r--models/access.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/models/access.js b/models/access.js
new file mode 100644
index 0000000..486ef5d
--- /dev/null
+++ b/models/access.js
@@ -0,0 +1,28 @@
+
+/**
+ * Module dependencies
+ */
+
+var mongoose = require('mongoose')
+ , Schema = mongoose.Schema;
+
+var AccessSchema = new Schema({
+ user: { type: String, ref: 'User' },
+ creator: { type: String, ref: 'User' },
+ project: { type: String, ref: 'Project' },
+ permissions: { type: Number, default: '3' },
+ created: { type: Date, default: Date.now },
+ updated: { type: Date, default: Date.now }
+});
+
+// the four validations below only apply if you are signing up traditionally
+
+ProjectSchema.methods = {
+
+ log: function() {
+ console.log('wat. wat logged this');
+ }
+
+}
+
+mongoose.model('Access', AccessSchema);