diff options
-rw-r--r-- | models/access.js | 28 | ||||
-rw-r--r-- | router.js | 2 |
2 files changed, 29 insertions, 1 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); @@ -50,7 +50,7 @@ module.exports = function(app, passport, auth) { */ - app.get('/dashboard', system.dashboard); + app.get('/dashboard', auth.requiresLogin, system.dashboard); app.get('/project', auth.requiresLogin, system.project); |